예제 #1
0
        public JsonWebTokenService(IOptionsMonitor <CryptoConfiguration> cryptoConfiguration, IEntityIdManager entityIdManager)
        {
            Guard.NotNull(cryptoConfiguration, nameof(cryptoConfiguration));
            Guard.NotNull(entityIdManager, nameof(entityIdManager));

            this._cryptoConfiguration = cryptoConfiguration;
            this._entityIdManager     = entityIdManager;
        }
예제 #2
0
        public static string TryAddCollectionName <T>(this IEntityIdManager self, string idWithoutCollectionName)
        {
            if (string.IsNullOrWhiteSpace(idWithoutCollectionName))
            {
                return(null);
            }

            return(self.AddCollectionName <T>(idWithoutCollectionName));
        }
예제 #3
0
        public CreateOrganizationRequestHandler(IAsyncDocumentSession session, IRequestContext context, IEntityIdManager entityIdManager)
        {
            Guard.NotNull(session, nameof(session));
            Guard.NotNull(context, nameof(context));
            Guard.NotNull(entityIdManager, nameof(entityIdManager));

            this._session         = session;
            this._context         = context;
            this._entityIdManager = entityIdManager;
        }
예제 #4
0
        public RegisterUserRequestHandler(IDocumentStore store, IAsyncDocumentSession session, IEntityIdManager entityIdManager)
        {
            Guard.NotNull(store, nameof(store));
            Guard.NotNull(session, nameof(session));
            Guard.NotNull(entityIdManager, nameof(entityIdManager));

            this._store           = store;
            this._session         = session;
            this._entityIdManager = entityIdManager;
        }
 public TrimCollectionNameFromIdConverter(IEntityIdManager entityIdManager)
 {
     this._entityIdManager = entityIdManager;
 }
예제 #6
0
파일: AuthToken.cs 프로젝트: haefele/Xemio
 public AuthToken(string token, IEntityIdManager entityIdManager)
     : base(token)
 {
     this._entityIdManager = entityIdManager;
 }
예제 #7
0
        private static AuthToken ParseAuthorizationHeader(string authorizationHeader, IEntityIdManager entityIdManager)
        {
            if (string.IsNullOrWhiteSpace(authorizationHeader))
            {
                return(null);
            }

            var parts = authorizationHeader.Split(' ');

            if (parts.Length != 2)
            {
                return(null);
            }

            if (string.Equals(parts[0], "Bearer", StringComparison.OrdinalIgnoreCase) == false)
            {
                return(null);
            }

            try
            {
                return(new AuthToken(parts[1], entityIdManager));
            }
            catch (Exception)
            {
                return(null);
            }
        }