SecurityServices.js
31 lines
| 910 B
| application/javascript
|
JavascriptLexer
|
|
r0 | /** | ||
| * Created by andrei on 21.08.16. | ||||
| */ | ||||
| define([ | ||||
| "dojo/_base/declare", | ||||
| "implab/safe", | ||||
| "./NoneSecData", | ||||
| "./SecData" | ||||
| ], function(declare, safe, NoneSecData, SecData) { | ||||
| let SecurityServices = declare(null, { | ||||
| }); | ||||
| SecurityServices.getSecurityDataService = function(tokenType) { | ||||
| switch (tokenType) { | ||||
| case this.PASSWORD_AUTH_TYPE: | ||||
| return new SecData(tokenType); | ||||
| case this.SATISFY_ANY_AUTH_TYPE: | ||||
| return new NoneSecData(); | ||||
| case this.REJECT_ALL_AUTH_TYPE: | ||||
| throw Error("NotImplemented"); | ||||
| default: | ||||
| throw Error("Unsupported auth type " + tokenType); | ||||
| } | ||||
| }; | ||||
| SecurityServices.PASSWORD_AUTH_TYPE = "password"; | ||||
| SecurityServices.SATISFY_ANY_AUTH_TYPE = "satisfyany"; | ||||
| SecurityServices.REJECT_ALL_AUTH_TYPE = "rejectall"; | ||||
| return SecurityServices; | ||||
| }); | ||||
