Struct google_cloud_storage::sign::SignedURLOptions
source · pub struct SignedURLOptions {
pub google_access_id: String,
pub sign_by: SignBy,
pub method: SignedURLMethod,
pub expires: Duration,
pub content_type: Option<String>,
pub headers: Vec<String>,
pub query_parameters: HashMap<String, Vec<String>>,
pub md5: Option<String>,
pub style: Box<dyn URLStyle + Send + Sync>,
pub insecure: bool,
}Expand description
SignedURLOptions allows you to restrict the access to the signed URL.
Fields§
§google_access_id: StringGoogleAccessID represents the authorizer of the signed URL generation. It is typically the Google service account client email address from the Google Developers Console in the form of “xxx@developer.gserviceaccount.com”. Required.
sign_by: SignByPrivateKey is the Google service account private key. It is obtainable
from the Google Developers Console.
At https://console.developers.google.com/project/
$ openssl pkcs12 -in key.p12 -passin pass:notasecret -out key.pem -nodes
Provide the contents of the PEM file as a byte slice. Exactly one of PrivateKey or SignBytes must be non-nil.
SignBytes is a function for implementing custom signing.
method: SignedURLMethodMethod is the HTTP method to be used with the signed URL. Signed URLs can be used with GET, HEAD, PUT, and DELETE requests. Required.
expires: DurationExpires is the expiration time on the signed URL. It must be a datetime in the future. For SigningSchemeV4, the expiration may be no more than seven days in the future. Required.
content_type: Option<String>ContentType is the content type header the client must provide to use the generated signed URL. Optional.
headers: Vec<String>Headers is a list of extension headers the client must provide in order to use the generated signed URL. Each must be a string of the form “key:values”, with multiple values separated by a semicolon. Optional.
query_parameters: HashMap<String, Vec<String>>QueryParameters is a map of additional query parameters. When SigningScheme is V4, this is used in computing the signature, and the client must use the same query parameters when using the generated signed URL. Optional.
md5: Option<String>MD5 is the base64 encoded MD5 checksum of the file. If provided, the client should provide the exact value on the request header in order to use the signed URL. Optional.
style: Box<dyn URLStyle + Send + Sync>Style provides options for the type of URL to use. Options are PathStyle (default), BucketBoundHostname, and VirtualHostedStyle. See https://cloud.google.com/storage/docs/request-endpoints for details. Only supported for V4 signing. Optional.
insecure: boolInsecure determines whether the signed URL should use HTTPS (default) or HTTP. Only supported for V4 signing. Optional.