C# Class OpenStack.Security.Authentication.DelegatingPartialAuthenticationService

This class serves as the base class for IAuthenticationService implementations which only authenticate certain HTTP API calls.
Inheritance: IAuthenticationService
显示文件 Open project: crowdy/OpenStack-ConoHa

Public Methods

Method Description
AuthenticateRequestAsync ( HttpRequestMessage requestMessage, CancellationToken cancellationToken ) : Task This implementation calls IsAuthenticatedCall to determine whether or not a particular HTTP API call should be treated as an "authenticated" call. The behavior of this method depends on the result of that method, as shown in the following table. IsAuthenticatedCall Behavior Authenticate requestMessage using the AuthenticatedCallsService authentication service. Authenticate requestMessage using the UnauthenticatedCallsService authentication service. Return without altering requestMessage at all.
GetBaseAddressAsync ( string serviceType, string serviceName, string region, bool internalAddress, CancellationToken cancellationToken ) : Task

The base implementation always uses AuthenticatedCallsService to provide the behavior for this method.

Protected Methods

Method Description
DelegatingPartialAuthenticationService ( IAuthenticationService authenticatedCallsService, IAuthenticationService unauthenticatedCallsService ) : System

Initializes a new instance of the DelegatingPartialAuthenticationService class with the specified delegate authentication service implementations to use for authenticating calls made from a client.

IsAuthenticatedCall ( HttpRequestMessage requestMessage ) : bool?

Determines whether or not a particular HTTP API call should be treated as an authenticated call or an unauthenticated call.

Method Details

AuthenticateRequestAsync() public method

This implementation calls IsAuthenticatedCall to determine whether or not a particular HTTP API call should be treated as an "authenticated" call. The behavior of this method depends on the result of that method, as shown in the following table. IsAuthenticatedCall Behavior Authenticate requestMessage using the AuthenticatedCallsService authentication service. Authenticate requestMessage using the UnauthenticatedCallsService authentication service. Return without altering requestMessage at all.
public AuthenticateRequestAsync ( HttpRequestMessage requestMessage, CancellationToken cancellationToken ) : Task
requestMessage System.Net.Http.HttpRequestMessage
cancellationToken System.Threading.CancellationToken
return Task

DelegatingPartialAuthenticationService() protected method

Initializes a new instance of the DelegatingPartialAuthenticationService class with the specified delegate authentication service implementations to use for authenticating calls made from a client.
/// If is . /// -or- /// If is . ///
protected DelegatingPartialAuthenticationService ( IAuthenticationService authenticatedCallsService, IAuthenticationService unauthenticatedCallsService ) : System
authenticatedCallsService IAuthenticationService /// The authentication service to use for authenticated HTTP API calls. ///
unauthenticatedCallsService IAuthenticationService /// The authentication service to use for unauthenticated HTTP API calls. ///
return System

GetBaseAddressAsync() public method

The base implementation always uses AuthenticatedCallsService to provide the behavior for this method.

If a recursive call to this method is detected.
public GetBaseAddressAsync ( string serviceType, string serviceName, string region, bool internalAddress, CancellationToken cancellationToken ) : Task
serviceType string
serviceName string
region string
internalAddress bool
cancellationToken System.Threading.CancellationToken
return Task

IsAuthenticatedCall() protected abstract method

Determines whether or not a particular HTTP API call should be treated as an authenticated call or an unauthenticated call.
/// If is . ///
protected abstract IsAuthenticatedCall ( HttpRequestMessage requestMessage ) : bool?
requestMessage System.Net.Http.HttpRequestMessage The representing the HTTP API call.
return bool?