verifiedaccess
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package verifiedaccess provides access to the Chrome Verified Access API.
For product documentation, see:https://developers.google.com/chrome/verified-access
Library status¶
These client libraries are officially supported by Google. However, thislibrary is considered complete and is in maintenance mode. This meansthat we will address critical bugs and security issues but will not addany new features.
When possible, we recommend using our newer[Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)that are still actively being worked and iterated on.
Creating a client¶
Usage example:
import "google.golang.org/api/verifiedaccess/v1"...ctx := context.Background()verifiedaccessService, err := verifiedaccess.NewService(ctx)
In this example, Google Application Default Credentials are used forauthentication. For information on how to create and obtain ApplicationDefault Credentials, seehttps://developers.google.com/identity/protocols/application-default-credentials.
Other authentication options¶
To use an API key for authentication (note: some APIs do not support APIkeys), usegoogle.golang.org/api/option.WithAPIKey:
verifiedaccessService, err := verifiedaccess.NewService(ctx, option.WithAPIKey("AIza..."))To use an OAuth token (e.g., a user token obtained via a three-legged OAuthflow, usegoogle.golang.org/api/option.WithTokenSource:
config := &oauth2.Config{...}// ...token, err := config.Exchange(ctx, ...)verifiedaccessService, err := verifiedaccess.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))Seegoogle.golang.org/api/option.ClientOption for details on options.
Index¶
- Constants
- type Challenge
- type ChallengeCreateCall
- type ChallengeService
- type ChallengeVerifyCall
- func (c *ChallengeVerifyCall) Context(ctx context.Context) *ChallengeVerifyCall
- func (c *ChallengeVerifyCall) Do(opts ...googleapi.CallOption) (*VerifyChallengeResponseResult, error)
- func (c *ChallengeVerifyCall) Fields(s ...googleapi.Field) *ChallengeVerifyCall
- func (c *ChallengeVerifyCall) Header() http.Header
- type Empty
- type Service
- type SignedData
- type VerifyChallengeResponseRequest
- type VerifyChallengeResponseResult
Constants¶
const (// Verify your enterprise credentialsVerifiedaccessScope = "https://www.googleapis.com/auth/verifiedaccess")OAuth2 scopes used by this API.
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typeChallenge¶
type Challenge struct {// AlternativeChallenge: Challenge generated with the old signing key (this// will only be present during key rotation)AlternativeChallenge *SignedData `json:"alternativeChallenge,omitempty"`// Challenge: Generated challengeChallenge *SignedData `json:"challenge,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "AlternativeChallenge") to// unconditionally include in API requests. By default, fields with empty or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "AlternativeChallenge") to include// in API requests with the JSON null value. By default, fields with empty// values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}Challenge: Result message for VerifiedAccess.CreateChallenge.
func (Challenge)MarshalJSON¶
typeChallengeCreateCall¶
type ChallengeCreateCall struct {// contains filtered or unexported fields}func (*ChallengeCreateCall)Context¶
func (c *ChallengeCreateCall) Context(ctxcontext.Context) *ChallengeCreateCall
Context sets the context to be used in this call's Do method.
func (*ChallengeCreateCall)Do¶
func (c *ChallengeCreateCall) Do(opts ...googleapi.CallOption) (*Challenge,error)
Do executes the "verifiedaccess.challenge.create" call.Any non-2xx status code is an error. Response headers are in either*Challenge.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.
func (*ChallengeCreateCall)Fields¶
func (c *ChallengeCreateCall) Fields(s ...googleapi.Field) *ChallengeCreateCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*ChallengeCreateCall)Header¶
func (c *ChallengeCreateCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
typeChallengeService¶
type ChallengeService struct {// contains filtered or unexported fields}funcNewChallengeService¶
func NewChallengeService(s *Service) *ChallengeService
func (*ChallengeService)Create¶
func (r *ChallengeService) Create(empty *Empty) *ChallengeCreateCall
Create: CreateChallenge API
func (*ChallengeService)Verify¶
func (r *ChallengeService) Verify(verifychallengeresponserequest *VerifyChallengeResponseRequest) *ChallengeVerifyCall
Verify: VerifyChallengeResponse API
typeChallengeVerifyCall¶
type ChallengeVerifyCall struct {// contains filtered or unexported fields}func (*ChallengeVerifyCall)Context¶
func (c *ChallengeVerifyCall) Context(ctxcontext.Context) *ChallengeVerifyCall
Context sets the context to be used in this call's Do method.
func (*ChallengeVerifyCall)Do¶
func (c *ChallengeVerifyCall) Do(opts ...googleapi.CallOption) (*VerifyChallengeResponseResult,error)
Do executes the "verifiedaccess.challenge.verify" call.Any non-2xx status code is an error. Response headers are in either*VerifyChallengeResponseResult.ServerResponse.Header or (if a response wasreturned at all) in error.(*googleapi.Error).Header. Usegoogleapi.IsNotModified to check whether the returned error was becausehttp.StatusNotModified was returned.
func (*ChallengeVerifyCall)Fields¶
func (c *ChallengeVerifyCall) Fields(s ...googleapi.Field) *ChallengeVerifyCall
Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.
func (*ChallengeVerifyCall)Header¶
func (c *ChallengeVerifyCall) Header()http.Header
Header returns a http.Header that can be modified by the caller to addheaders to the request.
typeEmpty¶
type Empty struct {}Empty: A generic empty message that you can re-use to avoid definingduplicated empty messages in your APIs. A typical example is to use it asthe request or the response type of an API method. For instance: service Foo{ rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
typeService¶
type Service struct {BasePathstring// API endpoint base URLUserAgentstring// optional additional User-Agent fragmentChallenge *ChallengeService// contains filtered or unexported fields} funcNewdeprecated
New creates a new Service. It uses the provided http.Client for requests.
Deprecated: please use NewService instead.To provide a custom HTTP client, use option.WithHTTPClient.If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
funcNewService¶
NewService creates a new Service.
typeSignedData¶
type SignedData struct {// Data: The data to be signed.Datastring `json:"data,omitempty"`// Signature: The signature of the data field.Signaturestring `json:"signature,omitempty"`// ForceSendFields is a list of field names (e.g. "Data") to unconditionally// include in API requests. By default, fields with empty or default values are// omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "Data") to include in API requests// with the JSON null value. By default, fields with empty values are omitted// from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}SignedData: The wrapper message of any data and its signature.
func (SignedData)MarshalJSON¶
func (sSignedData) MarshalJSON() ([]byte,error)
typeVerifyChallengeResponseRequest¶
type VerifyChallengeResponseRequest struct {// ChallengeResponse: The generated response to the challengeChallengeResponse *SignedData `json:"challengeResponse,omitempty"`// ExpectedIdentity: Service can optionally provide identity information about// the device or user associated with the key. For an EMK, this value is the// enrolled domain. For an EUK, this value is the user's email address. If// present, this value will be checked against contents of the response, and// verification will fail if there is no match.ExpectedIdentitystring `json:"expectedIdentity,omitempty"`// ForceSendFields is a list of field names (e.g. "ChallengeResponse") to// unconditionally include in API requests. By default, fields with empty or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "ChallengeResponse") to include in// API requests with the JSON null value. By default, fields with empty values// are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}VerifyChallengeResponseRequest: signed ChallengeResponse
func (VerifyChallengeResponseRequest)MarshalJSON¶
func (sVerifyChallengeResponseRequest) MarshalJSON() ([]byte,error)
typeVerifyChallengeResponseResult¶
type VerifyChallengeResponseResult struct {// AttestedDeviceId: Attested device id (ADID) of the device, read from the// verified data.AttestedDeviceIdstring `json:"attestedDeviceId,omitempty"`// DeviceEnrollmentId: Device enrollment id is returned in this field (for the// machine response only).DeviceEnrollmentIdstring `json:"deviceEnrollmentId,omitempty"`// DevicePermanentId: Device permanent id is returned in this field (for the// machine response only).DevicePermanentIdstring `json:"devicePermanentId,omitempty"`// SignedPublicKeyAndChallenge: Certificate Signing Request (in the SPKAC// format, base64 encoded) is returned in this field. This field will be set// only if device has included CSR in its challenge response. (the option to// include CSR is now available for both user and machine responses)SignedPublicKeyAndChallengestring `json:"signedPublicKeyAndChallenge,omitempty"`// VerificationOutput: For EMCert check, device permanent id is returned here.// For EUCert check, signed_public_key_and_challenge [base64 encoded] is// returned if present, otherwise empty string is returned. This field is// deprecated, please use device_permanent_id or// signed_public_key_and_challenge fields.VerificationOutputstring `json:"verificationOutput,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "AttestedDeviceId") to// unconditionally include in API requests. By default, fields with empty or// default values are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more// details.ForceSendFields []string `json:"-"`// NullFields is a list of field names (e.g. "AttestedDeviceId") to include in// API requests with the JSON null value. By default, fields with empty values// are omitted from API requests. See//https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.NullFields []string `json:"-"`}VerifyChallengeResponseResult: Result message forVerifiedAccess.VerifyChallengeResponse.
func (VerifyChallengeResponseResult)MarshalJSON¶
func (sVerifyChallengeResponseResult) MarshalJSON() ([]byte,error)