C# Класс Akamai.EdgeGrid.Auth.EdgeGridV1Signer

The EdgeGrid Signer is responsible for brokering a requests.This class is responsible for the core interaction logic given an API command and the associated set of parameters. When event is executed, the 'Authorization' header is decorated If connection is going to be reused, pass the persistent HttpWebRequest object when calling execute() TODO: support rebinding on IO communication errors (eg: connection reset) TODO: support Async callbacks and Async IO TODO: support multiplexing TODO: optimize and adapt throughput based on connection latency Author: [email protected] (Colin Bendell)
Наследование: IRequestSigner
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
GetAuthDataValue string
GetAuthorizationHeaderValue string
GetRequestData string
GetRequestHeaders string
GetRequestStreamHash string

Открытые методы

Метод Описание
EdgeGridV1Signer ( IList headers = null, long maxBodyHashSize = 2048 ) : System
Execute ( WebRequest request, ClientCredential credential, Stream uploadStream = null ) : Stream

Opens the connection to the {OPEN} API, assembles the signing headers and uploads any files.

Sign ( WebRequest request, ClientCredential credential, Stream uploadStream = null ) : WebRequest

Signs the given request with the given client credential.

Validate ( WebResponse response ) : void

Validates the response and attempts to detect root causes for failures for non 200 responses. The most common cause is due to time synchronization of the local server. If the local server is more than 30seconds out of sync then the API server will reject the request. TODO: catch rate limitting errors. Should delay and retry.

Приватные методы

Метод Описание
GetAuthDataValue ( ClientCredential credential, System.DateTime timestamp ) : string
GetAuthorizationHeaderValue ( ClientCredential credential, System.DateTime timestamp, string authData, string requestData ) : string
GetRequestData ( string method, Uri uri, NameValueCollection requestHeaders = null, Stream requestStream = null ) : string
GetRequestHeaders ( NameValueCollection requestHeaders ) : string
GetRequestStreamHash ( Stream requestStream ) : string

Описание методов

EdgeGridV1Signer() публичный Метод

public EdgeGridV1Signer ( IList headers = null, long maxBodyHashSize = 2048 ) : System
headers IList
maxBodyHashSize long
Результат System

Execute() публичный Метод

Opens the connection to the {OPEN} API, assembles the signing headers and uploads any files.
public Execute ( WebRequest request, ClientCredential credential, Stream uploadStream = null ) : Stream
request System.Net.WebRequest the
credential ClientCredential
uploadStream Stream
Результат Stream

Sign() публичный Метод

Signs the given request with the given client credential.
public Sign ( WebRequest request, ClientCredential credential, Stream uploadStream = null ) : WebRequest
request System.Net.WebRequest The web request to sign
credential ClientCredential the credential used in the signing
uploadStream Stream
Результат System.Net.WebRequest

Validate() публичный Метод

Validates the response and attempts to detect root causes for failures for non 200 responses. The most common cause is due to time synchronization of the local server. If the local server is more than 30seconds out of sync then the API server will reject the request. TODO: catch rate limitting errors. Should delay and retry.
public Validate ( WebResponse response ) : void
response System.Net.WebResponse the active response object
Результат void