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
파일 보기 프로젝트 열기: surgeforward/AkamaiOPEN-edgegrid-C-Sharp 1 사용 예제들

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