Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Commit

Permalink
Feature/user security (#84)
Browse files Browse the repository at this point in the history
Adding:

- `/me/accessRestriction*`
- `/me/identity*`
  • Loading branch information
antleblanc authored May 25, 2018
1 parent 59b128d commit ef7356a
Show file tree
Hide file tree
Showing 21 changed files with 2,038 additions and 951 deletions.
543 changes: 543 additions & 0 deletions dist/ovh-api-services.js

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions dist/ovh-api-services.min.js

Large diffs are not rendered by default.

1,902 changes: 960 additions & 942 deletions package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
angular.module("ovh-api-services").service("OvhApiMeAccessRestrictionBackupCode", function ($injector) {
"use strict";

return {
v6: function () {
return $injector.get("OvhApiMeAccessRestrictionBackupCodeV6");
}
};

});
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
angular.module("ovh-api-services").service("OvhApiMeAccessRestrictionBackupCodeV6", function ($cacheFactory, $resource) {
"use strict";

var cache = $cacheFactory("OvhApiMeAccessRestrictionBackupCodeV6");
var queryCache = $cacheFactory("OvhApiMeAccessRestrictionBackupCodeV6Query");

var interceptor = {
response: function (response) {
cache.remove(response.config.url);
queryCache.removeAll();
return response.resource;
}
};

var resource = $resource("/me/accessRestriction/backupCode", {}, {
get: {
method: "GET",
cache: cache
},
create: {
method: "POST",
interceptor: interceptor
},
"delete": {
method: "DELETE",
interceptor: interceptor
},
disable: {
method: "POST",
url: "/me/accessRestriction/backupCode/disable",
interceptor: interceptor
},
enable: {
method: "POST",
url: "/me/accessRestriction/backupCode/enable",
interceptor: interceptor
},
validate: {
method: "POST",
url: "/me/accessRestriction/backupCode/validate",
interceptor: interceptor
}
});

resource.resetCache = function () {
cache.removeAll();
};

resource.resetQueryCache = function () {
queryCache.removeAll();
};

resource.resetAllCache = function () {
this.resetCache();
this.resetQueryCache();
};

return resource;
});
10 changes: 10 additions & 0 deletions src/me/accessRestriction/ip/me-accessRestriction-ip.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
angular.module("ovh-api-services").service("OvhApiMeAccessRestrictionIp", function ($injector) {
"use strict";

return {
v6: function () {
return $injector.get("OvhApiMeAccessRestrictionIpV6");
}
};

});
56 changes: 56 additions & 0 deletions src/me/accessRestriction/ip/me-accessRestriction-ip.v6.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
angular.module("ovh-api-services").service("OvhApiMeAccessRestrictionIpV6", function ($cacheFactory, $resource) {
"use strict";

var cache = $cacheFactory("OvhApiMeAccessRestrictionIpV6");
var queryCache = $cacheFactory("OvhApiMeAccessRestrictionIpV6Query");

var interceptor = {
response: function (response) {
cache.remove(response.config.url);
queryCache.removeAll();
return response.resource;
}
};

var resource = $resource("/me/accessRestriction/ip/:ip", {
ip: "@ip"
}, {
query: {
method: "GET",
isArray: true,
cache: queryCache
},
get: {
method: "GET",
cache: cache
},
create: {
method: "POST",
url: "/me/accessRestriction/ip",
interceptor: interceptor
},
update: {
method: "PUT",
interceptor: interceptor
},
"delete": {
method: "DELETE",
interceptor: interceptor
}
});

resource.resetCache = function () {
cache.removeAll();
};

resource.resetQueryCache = function () {
queryCache.removeAll();
};

resource.resetAllCache = function () {
this.resetCache();
this.resetQueryCache();
};

return resource;
});
25 changes: 25 additions & 0 deletions src/me/accessRestriction/me-accessRestriction.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
angular.module("ovh-api-services").service("OvhApiMeAccessRestriction", function ($injector) {
"use strict";

return {
BackupCode: function () {
return $injector.get("OvhApiMeAccessRestrictionBackupCode");
},
Ip: function () {
return $injector.get("OvhApiMeAccessRestrictionIp");
},
v6: function () {
return $injector.get("OvhApiMeAccessRestrictionV6");
},
Sms: function () {
return $injector.get("OvhApiMeAccessRestrictionSms");
},
Totp: function () {
return $injector.get("OvhApiMeAccessRestrictionTotp");
},
U2f: function () {
return $injector.get("OvhApiMeAccessRestrictionU2f");
}
};

});
22 changes: 22 additions & 0 deletions src/me/accessRestriction/me-accessRestriction.v6.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
angular.module("ovh-api-services").service("OvhApiMeAccessRestrictionV6", function ($resource) {
"use strict";

return $resource("/me/accessRestriction", {}, {
developerMode: {
url: "/me/accessRestriction/developerMode",
method: "GET"
},
updateDeveloperMode: {
url: "/me/accessRestriction/developerMode",
method: "PUT"
},
ipDefaultRule: {
url: "/me/accessRestriction/ipDefaultRule",
method: "GET"
},
updateipDefaultRule: {
url: "/me/accessRestriction/ipDefaultRule",
method: "PUT"
}
});
});
10 changes: 10 additions & 0 deletions src/me/accessRestriction/sms/me-accessRestriction-sms.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
angular.module("ovh-api-services").service("OvhApiMeAccessRestrictionSms", function ($injector) {
"use strict";

return {
v6: function () {
return $injector.get("OvhApiMeAccessRestrictionSmsV6");
}
};

});
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
angular.module("ovh-api-services").service("OvhApiMeAccessRestrictionSmsV6", function ($cacheFactory, $resource) {
"use strict";

var cache = $cacheFactory("OvhApiMeAccessRestrictionSmsV6");
var queryCache = $cacheFactory("OvhApiMeAccessRestrictionSmsV6Query");

var interceptor = {
response: function (response) {
cache.remove(response.config.url);
queryCache.removeAll();
return response.resource;
}
};

var resource = $resource("/me/accessRestriction/sms/:id", {
id: "@id"
}, {
query: {
method: "GET",
isArray: true,
cache: queryCache
},
get: {
method: "GET",
cache: cache
},
create: {
method: "POST",
url: "/me/accessRestriction/sms",
interceptor: interceptor
},
update: {
method: "PUT",
interceptor: interceptor
},
"delete": {
method: "DELETE",
interceptor: interceptor
},
disable: {
method: "POST",
url: "/me/accessRestriction/sms/:id/disable",
interceptor: interceptor
},
enable: {
method: "POST",
url: "/me/accessRestriction/sms/:id/enable",
interceptor: interceptor
},
sendCode: {
method: "POST",
url: "/me/accessRestriction/sms/:id/sendCode",
interceptor: interceptor
},
validate: {
method: "POST",
url: "/me/accessRestriction/sms/:id/validate",
interceptor: interceptor
}
});

resource.resetCache = function () {
cache.removeAll();
};

resource.resetQueryCache = function () {
queryCache.removeAll();
};

resource.resetAllCache = function () {
this.resetCache();
this.resetQueryCache();
};

return resource;
});
10 changes: 10 additions & 0 deletions src/me/accessRestriction/totp/me-accessRestriction-totp.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
angular.module("ovh-api-services").service("OvhApiMeAccessRestrictionTotp", function ($injector) {
"use strict";

return {
v6: function () {
return $injector.get("OvhApiMeAccessRestrictionTotpV6");
}
};

});
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
angular.module("ovh-api-services").service("OvhApiMeAccessRestrictionTotpV6", function ($cacheFactory, $resource) {
"use strict";

var cache = $cacheFactory("OvhApiMeAccessRestrictionTotpV6");
var queryCache = $cacheFactory("OvhApiMeAccessRestrictionTotpV6Query");

var interceptor = {
response: function (response) {
cache.remove(response.config.url);
queryCache.removeAll();
return response.resource;
}
};

var resource = $resource("/me/accessRestriction/totp/:id", {
id: "@id"
}, {
query: {
method: "GET",
isArray: true,
cache: queryCache
},
get: {
method: "GET",
cache: cache
},
create: {
method: "POST",
url: "/me/accessRestriction/totp",
interceptor: interceptor
},
update: {
method: "PUT",
interceptor: interceptor
},
"delete": {
method: "DELETE",
interceptor: interceptor
},
disable: {
method: "POST",
url: "/me/accessRestriction/totp/:id/disable",
interceptor: interceptor
},
enable: {
method: "POST",
url: "/me/accessRestriction/totp/:id/enable",
interceptor: interceptor
},
validate: {
method: "POST",
url: "/me/accessRestriction/totp/:id/validate",
interceptor: interceptor
}
});

resource.resetCache = function () {
cache.removeAll();
};

resource.resetQueryCache = function () {
queryCache.removeAll();
};

resource.resetAllCache = function () {
this.resetCache();
this.resetQueryCache();
};

return resource;
});
10 changes: 10 additions & 0 deletions src/me/accessRestriction/u2f/me-accessRestriction-u2f.service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
angular.module("ovh-api-services").service("OvhApiMeAccessRestrictionU2f", function ($injector) {
"use strict";

return {
v6: function () {
return $injector.get("OvhApiMeAccessRestrictionU2fV6");
}
};

});
Loading

0 comments on commit ef7356a

Please sign in to comment.