public void RemoveClaimTest() { cache.AddOrUpdateClaim("resouce:operation", "resouce:operation"); Assert.AreEqual("resouce:operation", cache.GetClaim("resouce:operation")); cache.RemoveClaim("resouce:operation"); Assert.IsNull(cache.GetClaim("resouce:operation")); }
async Task IIamProvider.RemoveClaim(string policyName, IIamProviderCache cache) { var policyId = await CreateOrGetPolicy(policyName); var claim = await _context.IamPolicyClaims.FirstOrDefaultAsync(x => x.PolicyId.Equals(policyId)); if (claim != null) { _context.IamPolicyClaims.Remove(claim); await _context.SaveChangesAsync(); } cache.RemoveClaim(policyName); }
Task IIamProvider.RemoveClaim(string policyName, IIamProviderCache cache) { cache.RemoveClaim(policyName); return(Task.CompletedTask); }