예제 #1
0
 private static void AddPoliciesToClaims(string[] policies, IIamProvider iamProvider, IIamProviderCache iamProviderCache)
 {
     foreach (var policy in policies)
     {
         iamProvider.AddClaim(policy, policy, iamProviderCache).Wait();
     }
 }
예제 #2
0
 private static void TogglePolicyResourceIdAccess(string[] policies, IIamProvider iamProvider, IIamProviderCache iamProviderCache)
 {
     foreach (var policy in policies)
     {
         iamProvider.ToggleResourceIdAccess(policy, true, iamProviderCache).Wait();
     }
 }
예제 #3
0
 private static void AddPoliciesToRoles(string[] policies, string[] roles, IIamProvider iamProvider, IIamProviderCache iamProviderCache)
 {
     foreach (var policy in policies)
     {
         foreach (var role in roles)
         {
             iamProvider.AddRole(policy, role, iamProviderCache).Wait();
         }
     }
 }
예제 #4
0
        public IamAuthorizationPolicyProvider(IOptions <AuthorizationOptions> options, IIamProvider iamProvider, IIamProviderCache iamProviderCache) : base(options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            _options = options.Value;

            _iamProvider      = iamProvider ?? throw new ArgumentNullException(nameof(iamProvider));
            _iamProviderCache = iamProviderCache ?? throw new ArgumentNullException(nameof(iamProviderCache));
        }