/// <summary> /// Initializes a new instance of the <see cref="AuthorizationContext"/> class. /// </summary> /// <param name="kernel">The kernel.</param> /// <param name="authorizationStore">The <see cref="IAuthorizationStore"/>.</param> /// <param name="authorizationHandler">The <see cref="IAuthorizationHandler"/>.</param> /// <param name="authorizationContextConfiguration">The <see cref="IAuthorizationContextConfiguration"/>.</param> /// <exception cref="ArgumentNullException">The value of '<paramref name="kernel"/>', '<paramref name="authorizationHandler"/>', '<paramref name="authorizationStore"/>' and '<paramref name="authorizationContextConfiguration"/>' cannot be null. </exception> public AuthorizationContext([NotNull] IKernel kernel, [NotNull] IAuthorizationStore authorizationStore, [NotNull] IAuthorizationHandler authorizationHandler, [NotNull] IAuthorizationContextConfiguration authorizationContextConfiguration) { if (kernel == null) { throw new ArgumentNullException(nameof(kernel)); } if (authorizationStore == null) { throw new ArgumentNullException(nameof(authorizationStore)); } if (authorizationHandler == null) { throw new ArgumentNullException(nameof(authorizationHandler)); } if (authorizationContextConfiguration == null) { throw new ArgumentNullException(nameof(authorizationContextConfiguration)); } this.Kernel = kernel; this.authorizationStore = authorizationStore; this.authorizationHandler = authorizationHandler; this.AuthorizationContextConfiguration = authorizationContextConfiguration; this.AuthorizationContextState = new UnauthorizedAuthorizationContextState(authorizationStore, authorizationHandler); }
/// <summary> /// Initializes a new instance of the <see cref="AuthorizationContextState"/> class. /// </summary> /// <param name="authorizationStore">The <see cref="IAuthorizationStore"/>.</param> /// <param name="authorizationHandler">The <see cref="IAuthorizationHandler"/>.</param> /// <exception cref="ArgumentNullException">The value of '<paramref name="authorizationHandler"/>' and '<paramref name="authorizationStore"/>' cannot be null. </exception> protected AuthorizationContextState([NotNull] IAuthorizationStore authorizationStore, [NotNull] IAuthorizationHandler authorizationHandler) { if (authorizationStore == null) { throw new ArgumentNullException(nameof(authorizationStore)); } if (authorizationHandler == null) { throw new ArgumentNullException(nameof(authorizationHandler)); } this.AuthorizationStore = authorizationStore; this.AuthorizationHandler = authorizationHandler; }
/// <summary> /// Initializes a new instance of the <see cref="AuthorizationContextState"/> class. /// </summary> /// <param name="authorizationStore">The <see cref="IAuthorizationStore"/>.</param> /// <param name="authorizationHandler">The <see cref="IAuthorizationHandler"/>.</param> /// <exception cref="ArgumentNullException">The value of '<paramref name="authorizationHandler" />' and '<paramref name="authorizationStore" />' cannot be null. </exception> public UnauthorizedAuthorizationContextState(IAuthorizationStore authorizationStore, IAuthorizationHandler authorizationHandler) : base(authorizationStore, authorizationHandler) { }
/// <summary> /// Initializes a new instance of the <see cref="AuthorizedAuthorizationContextState"/> class. /// </summary> /// <param name="inMemoryAuthorizationState">The in-memory authorization state.</param> /// <param name="authorizationStore">The <see cref="IAuthorizationStore"/>.</param> /// <param name="authorizationHandler">The <see cref="IAuthorizationHandler"/>.</param> /// <param name="authorizationConfiguration">The <see cref="IAuthorizationConfiguration"/>.</param> /// <exception cref="ArgumentNullException">The value of '<paramref name="authorizationHandler" />', '<paramref name="inMemoryAuthorizationState"/>', '<paramref name="authorizationConfiguration"/>' and '<paramref name="authorizationStore" />' cannot be null. </exception> public AuthorizedAuthorizationContextState(AuthorizationState inMemoryAuthorizationState, IAuthorizationStore authorizationStore, IAuthorizationHandler authorizationHandler, IAuthorizationConfiguration authorizationConfiguration) : base(authorizationStore, authorizationHandler) { if (inMemoryAuthorizationState == null) { throw new ArgumentNullException(nameof(inMemoryAuthorizationState)); } if (authorizationConfiguration == null) { throw new ArgumentNullException(nameof(authorizationConfiguration)); } this.inMemoryAuthorizationState = inMemoryAuthorizationState; this.authorizationConfiguration = authorizationConfiguration; }
/// <summary> /// Initializes a new instance of the <see cref="GoogleAuthorizationContext"/> class. /// </summary> /// <param name="kernel">The kernel.</param> /// <param name="authorizationStore">The <see cref="IAuthorizationStore"/>.</param> /// <param name="authorizationHandler">The <see cref="IAuthorizationHandler"/>.</param> /// <param name="authorizationContextConfiguration">The <see cref="IAuthorizationContextConfiguration"/>.</param> /// <exception cref="ArgumentNullException">The value of '<paramref name="kernel" />', '<paramref name="authorizationHandler" />', '<paramref name="authorizationStore" />' and '<paramref name="authorizationContextConfiguration" />' cannot be null. </exception> public GoogleAuthorizationContext([NotNull] IKernel kernel, [NotNull] IAuthorizationStore authorizationStore, [NotNull] IAuthorizationHandler authorizationHandler, [NotNull] IAuthorizationContextConfiguration authorizationContextConfiguration) : base(kernel, authorizationStore, authorizationHandler, authorizationContextConfiguration) { }