rpcs

package
v0.0.0-...-8ff35f7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 1 Imported by: 3

Documentation

Overview

Package rpcs implements request/response used to get auth token via RPCs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseRequest

type BaseRequest struct {
	Secret    []byte `json:"secret"`
	AccountID string `json:"account_id"`
}

BaseRequest defines fields included in all requests.

func (*BaseRequest) Validate

func (r *BaseRequest) Validate() error

Validate checks that the request is structurally valid.

type BaseResponse

type BaseResponse struct {
	ErrorCode    int    `json:"error_code,omitempty"`
	ErrorMessage string `json:"error_message,omitempty"`
}

BaseResponse defines optional fields included in all responses.

type GetIDTokenRequest

type GetIDTokenRequest struct {
	BaseRequest

	Audience string `json:"audience"`
}

GetIDTokenRequest is parameters for GetIDToken RPC call.

func (*GetIDTokenRequest) Validate

func (r *GetIDTokenRequest) Validate() error

Validate checks that the request is structurally valid.

type GetIDTokenResponse

type GetIDTokenResponse struct {
	BaseResponse

	IDToken string `json:"id_token"`
	Expiry  int64  `json:"expiry"`
}

GetIDTokenResponse is returned by GetIDToken RPC call.

type GetOAuthTokenRequest

type GetOAuthTokenRequest struct {
	BaseRequest

	Scopes []string `json:"scopes"`
}

GetOAuthTokenRequest is parameters for GetOAuthToken RPC call.

func (*GetOAuthTokenRequest) Validate

func (r *GetOAuthTokenRequest) Validate() error

Validate checks that the request is structurally valid.

type GetOAuthTokenResponse

type GetOAuthTokenResponse struct {
	BaseResponse

	AccessToken string `json:"access_token"`
	Expiry      int64  `json:"expiry"`
}

GetOAuthTokenResponse is returned by GetOAuthToken RPC call.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL