init(credentials:name:region:algorithm:)
Initialise the Signer class with AWS credentials
init(credentials: Credential, name: String, region: String, algorithm: Algorithm)
Initialise the Signer class with AWS credentials
init(credentials: Credential, name: String, region: String, algorithm: Algorithm)
s12SotoSignerV49AWSSignerV11credentials4name6region9algorithmAcA10Credential_p_S2SAC9AlgorithmVtcfc
What are these?8SXE7
import SotoSignerV4
struct AWSSigner
Amazon Web Services V4 Signer
protocol Credential : Sendable
Protocol for providing credential details for accessing AWS services
@frozen struct String
A Unicode string value that is a collection of characters.
struct Algorithm
The algorithm used to create the hash of the canonical request
init(credentials: Credential, name: String, region: String)
Initialise the Signer class with AWS credentials
let algorithm: Algorithm
Signing algorithm
let credentials: Credential
Security credentials for accessing AWS services
let name: String
Service signing name. In general this is the same as the service name
let region: String
AWS region you are working in
func processURL(url: URL) -> URL?
Process URL before signing
func signChunk(body: BodyData, signingData: ChunkedSigningData) -> ChunkedSigningData
Generate the signature for a chunk in a s3 chunked upload
func signHeaders(url: URL, method: HTTPMethod = .GET, headers: HTTPHeaders = HTTPHeaders(), body: BodyData? = nil, omitSecurityToken: Bool = false, date: Date = Date()) -> HTTPHeaders
Generate signed headers, for an HTTP request using the AWS sigV4 algorithm.
func signURL(url: URL, method: HTTPMethod = .GET, headers: HTTPHeaders = HTTPHeaders(), body: BodyData? = nil, expires: TimeAmount, omitSecurityToken: Bool = false, date: Date = Date()) -> URL
Generate a signed URL, for a HTTP request
func startSigningChunks(url: URL, method: HTTPMethod = .GET, headers: HTTPHeaders = HTTPHeaders(), date: Date = Date()) -> (headers: HTTPHeaders, signingData: ChunkedSigningData)
Start the process of signing a s3 chunked upload.
func startSigningChunks(url: URL, method: HTTPMethod = .GET, headers: HTTPHeaders = HTTPHeaders(), date: Date = Date(), algorithm: Algorithm) -> (headers: HTTPHeaders, signingData: ChunkedSigningData)
Start the process of signing a s3 chunked upload.
enum BodyData
Enum for holding request payload
struct ChunkedSigningData
Temporary structure passed from calls to startSigningChunks
and subsequent calls to signChunk