/**
 * 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;
});
