Documentation ¶
Overview ¶
Package sas implements functionality for creating and verifying shared access signatures (SAS) and shared access tokens (SAT). A SAS grants querying capabilities to a dataset for a given time window and with a global filter applied on behalf of an organization. A SAS is an URL query string composed of a set of query parameters that make up the payload for a signature and the signature itself. That signature is a SAT. Shared access is only supported on Axiom Cloud.
To create a SAS string, that can be attached to a query request, use the high-level `Create()` function. The returned string is an already url-encoded query string.
To create a SAT string for a sat of values that make up a signature, use the low-level `CreateToken()` function. The returned string is an already base64 url-encoded string.
To verify a SAS string against a signing key use the `Verify()` function.
To verify a SAT string against a signing key and a set of values use the `VerifyToken()` function.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
Create creates a shared access signature using the given signing key and valid for the given options. The returned string is a query string that can be attached to a URL.
Shared access is only supported on Axiom Cloud.
func CreateToken ¶
CreateToken creates a shared access token signed with the given key and valid for the given options.
This function is only useful if the intention is to create the shared access signature manually and without the help of `Create`.
Shared access is only supported on Axiom Cloud.
func VerifyToken ¶
VerifyToken the the validity of given shared access token for the given Options using the given signing key.
An error is returend if the signature can't be processed. It will always return `false` in that case.
If no error is returned it returns `true` if the signature is valid. Otherwise it returns `false`.
Types ¶
type Options ¶
type Options struct { // OrganizationID is the ID of the organization the token and signature is // valid for. OrganizationID string // Dataset name the token and signature is valid for. Dataset string // Filter is the top-level query filter to apply to all query requests // the token and signature is valid for. Filter query.Filter // MinStartTime is the earliest query start time the token and signature is // valid for. MinStartTime time.Time // MaxEndTime is the latest query end time the token and signature is valid // for. MaxEndTime time.Time }
Options represents the options for creating a shared access token or a shared access signature.