Back to godoc.org

Package minter

v0.0.0-...-1557bcf
Latest Go to latest

The latest major version is .

Published: Aug 13, 2020 | License: Apache-2.0 | Module: github.com/luci/luci-go

Overview

Package minter contains the main API of the token server.

It is publicly accessible API used to mint various kinds of tokens.

Index

Variables

var ErrorCode_name = map[int32]string{
	0: "SUCCESS",
	1: "UNSUPPORTED_SIGNATURE",
	2: "UNSUPPORTED_TOKEN_TYPE",
	3: "BAD_TIMESTAMP",
	4: "BAD_CERTIFICATE_FORMAT",
	5: "BAD_SIGNATURE",
	6: "UNTRUSTED_CERTIFICATE",
	7: "BAD_TOKEN_ARGUMENTS",
	8: "MACHINE_TOKEN_MINTING_ERROR",
}
var ErrorCode_value = map[string]int32{
	"SUCCESS":                     0,
	"UNSUPPORTED_SIGNATURE":       1,
	"UNSUPPORTED_TOKEN_TYPE":      2,
	"BAD_TIMESTAMP":               3,
	"BAD_CERTIFICATE_FORMAT":      4,
	"BAD_SIGNATURE":               5,
	"UNTRUSTED_CERTIFICATE":       6,
	"BAD_TOKEN_ARGUMENTS":         7,
	"MACHINE_TOKEN_MINTING_ERROR": 8,
}
var ServiceAccountTokenKind_name = map[int32]string{
	0: "SERVICE_ACCOUNT_TOKEN_UNSPECIFIED",
	1: "SERVICE_ACCOUNT_TOKEN_ACCESS_TOKEN",
	2: "SERVICE_ACCOUNT_TOKEN_ID_TOKEN",
}
var ServiceAccountTokenKind_value = map[string]int32{
	"SERVICE_ACCOUNT_TOKEN_UNSPECIFIED":  0,
	"SERVICE_ACCOUNT_TOKEN_ACCESS_TOKEN": 1,
	"SERVICE_ACCOUNT_TOKEN_ID_TOKEN":     2,
}
var SignatureAlgorithm_name = map[int32]string{
	0: "UNKNOWN_ALGO",
	1: "SHA256_RSA_ALGO",
}
var SignatureAlgorithm_value = map[string]int32{
	"UNKNOWN_ALGO":    0,
	"SHA256_RSA_ALGO": 1,
}

func FileDescriptorSet

func FileDescriptorSet() *descriptor.FileDescriptorSet

FileDescriptorSet returns a descriptor set for this proto package, which includes all defined services, and all transitive dependencies.

Will not return nil.

Do NOT modify the returned descriptor.

func RegisterTokenMinterServer

func RegisterTokenMinterServer(s prpc.Registrar, srv TokenMinterServer)

type ErrorCode

type ErrorCode int32

Possible kinds of fatal errors.

Non fatal errors are returned as grpc.Internal errors instead.

const (
	ErrorCode_SUCCESS                     ErrorCode = 0
	ErrorCode_UNSUPPORTED_SIGNATURE       ErrorCode = 1
	ErrorCode_UNSUPPORTED_TOKEN_TYPE      ErrorCode = 2
	ErrorCode_BAD_TIMESTAMP               ErrorCode = 3
	ErrorCode_BAD_CERTIFICATE_FORMAT      ErrorCode = 4
	ErrorCode_BAD_SIGNATURE               ErrorCode = 5
	ErrorCode_UNTRUSTED_CERTIFICATE       ErrorCode = 6
	ErrorCode_BAD_TOKEN_ARGUMENTS         ErrorCode = 7
	ErrorCode_MACHINE_TOKEN_MINTING_ERROR ErrorCode = 8
)

func (ErrorCode) EnumDescriptor

func (ErrorCode) EnumDescriptor() ([]byte, []int)

func (ErrorCode) String

func (x ErrorCode) String() string

type LuciMachineToken

type LuciMachineToken struct {
	MachineToken         string               `protobuf:"bytes,1,opt,name=machine_token,json=machineToken,proto3" json:"machine_token,omitempty"`
	Expiry               *timestamp.Timestamp `protobuf:"bytes,2,opt,name=expiry,proto3" json:"expiry,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

LuciMachineToken is short lived machine token.

It is understood only by LUCI backends. It is a bearer token, that embeds machine hostname and details about the machine certificate it was issued for. It has short lifetime (usually 1h).

It is expected to be sent to backends in 'X-Luci-Machine-Token' HTTP header.

The token here is supposed to be treated as an opaque base64-encoded blob, but in reality it is serialized MachineTokenEnvelope, see machine_token.proto and read the comment there for more info about the token format.

func (*LuciMachineToken) Descriptor

func (*LuciMachineToken) Descriptor() ([]byte, []int)

func (*LuciMachineToken) GetExpiry

func (m *LuciMachineToken) GetExpiry() *timestamp.Timestamp

func (*LuciMachineToken) GetMachineToken

func (m *LuciMachineToken) GetMachineToken() string

func (*LuciMachineToken) ProtoMessage

func (*LuciMachineToken) ProtoMessage()

func (*LuciMachineToken) Reset

func (m *LuciMachineToken) Reset()

func (*LuciMachineToken) String

func (m *LuciMachineToken) String() string

func (*LuciMachineToken) XXX_DiscardUnknown

func (m *LuciMachineToken) XXX_DiscardUnknown()

func (*LuciMachineToken) XXX_Marshal

func (m *LuciMachineToken) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LuciMachineToken) XXX_Merge

func (m *LuciMachineToken) XXX_Merge(src proto.Message)

func (*LuciMachineToken) XXX_Size

func (m *LuciMachineToken) XXX_Size() int

func (*LuciMachineToken) XXX_Unmarshal

func (m *LuciMachineToken) XXX_Unmarshal(b []byte) error

type MachineTokenRequest

type MachineTokenRequest struct {
	Certificate []byte `protobuf:"bytes,1,opt,name=certificate,proto3" json:"certificate,omitempty"`

	SignatureAlgorithm SignatureAlgorithm "" /* 159 byte string literal not displayed */

	IssuedAt *timestamp.Timestamp `protobuf:"bytes,3,opt,name=issued_at,json=issuedAt,proto3" json:"issued_at,omitempty"`

	TokenType            api.MachineTokenType `protobuf:"varint,4,opt,name=token_type,json=tokenType,proto3,enum=tokenserver.MachineTokenType" json:"token_type,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

MachineTokenRequest contains the actual request parameters.

func (*MachineTokenRequest) Descriptor

func (*MachineTokenRequest) Descriptor() ([]byte, []int)

func (*MachineTokenRequest) GetCertificate

func (m *MachineTokenRequest) GetCertificate() []byte

func (*MachineTokenRequest) GetIssuedAt

func (m *MachineTokenRequest) GetIssuedAt() *timestamp.Timestamp

func (*MachineTokenRequest) GetSignatureAlgorithm

func (m *MachineTokenRequest) GetSignatureAlgorithm() SignatureAlgorithm

func (*MachineTokenRequest) GetTokenType

func (m *MachineTokenRequest) GetTokenType() api.MachineTokenType

func (*MachineTokenRequest) ProtoMessage

func (*MachineTokenRequest) ProtoMessage()

func (*MachineTokenRequest) Reset

func (m *MachineTokenRequest) Reset()

func (*MachineTokenRequest) String

func (m *MachineTokenRequest) String() string

func (*MachineTokenRequest) XXX_DiscardUnknown

func (m *MachineTokenRequest) XXX_DiscardUnknown()

func (*MachineTokenRequest) XXX_Marshal

func (m *MachineTokenRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MachineTokenRequest) XXX_Merge

func (m *MachineTokenRequest) XXX_Merge(src proto.Message)

func (*MachineTokenRequest) XXX_Size

func (m *MachineTokenRequest) XXX_Size() int

func (*MachineTokenRequest) XXX_Unmarshal

func (m *MachineTokenRequest) XXX_Unmarshal(b []byte) error

type MachineTokenResponse

type MachineTokenResponse struct {
	// Identifier of the service and its version that produced the token.
	//
	// Has the form "<app-id>/<module-version>". Reported to the monitoring by
	// the client. This is _not_ a part of the token.
	ServiceVersion string `protobuf:"bytes,2,opt,name=service_version,json=serviceVersion,proto3" json:"service_version,omitempty"`
	// The generated token.
	//
	// The exact field set here depends on a requested type of the token, see
	// MachineTokenRequest.token_type.
	//
	// Types that are valid to be assigned to TokenType:
	//	*MachineTokenResponse_LuciMachineToken
	TokenType            isMachineTokenResponse_TokenType `protobuf_oneof:"token_type"`
	XXX_NoUnkeyedLiteral struct{}                         `json:"-"`
	XXX_unrecognized     []byte                           `json:"-"`
	XXX_sizecache        int32                            `json:"-"`
}

MachineTokenResponse contains a token requested by MachineTokenRequest.

func (*MachineTokenResponse) Descriptor

func (*MachineTokenResponse) Descriptor() ([]byte, []int)

func (*MachineTokenResponse) GetLuciMachineToken

func (m *MachineTokenResponse) GetLuciMachineToken() *LuciMachineToken

func (*MachineTokenResponse) GetServiceVersion

func (m *MachineTokenResponse) GetServiceVersion() string

func (*MachineTokenResponse) GetTokenType

func (m *MachineTokenResponse) GetTokenType() isMachineTokenResponse_TokenType

func (*MachineTokenResponse) ProtoMessage

func (*MachineTokenResponse) ProtoMessage()

func (*MachineTokenResponse) Reset

func (m *MachineTokenResponse) Reset()

func (*MachineTokenResponse) String

func (m *MachineTokenResponse) String() string

func (*MachineTokenResponse) XXX_DiscardUnknown

func (m *MachineTokenResponse) XXX_DiscardUnknown()

func (*MachineTokenResponse) XXX_Marshal

func (m *MachineTokenResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MachineTokenResponse) XXX_Merge

func (m *MachineTokenResponse) XXX_Merge(src proto.Message)

func (*MachineTokenResponse) XXX_OneofWrappers

func (*MachineTokenResponse) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*MachineTokenResponse) XXX_Size

func (m *MachineTokenResponse) XXX_Size() int

func (*MachineTokenResponse) XXX_Unmarshal

func (m *MachineTokenResponse) XXX_Unmarshal(b []byte) error

type MachineTokenResponse_LuciMachineToken

type MachineTokenResponse_LuciMachineToken struct {
	LuciMachineToken *LuciMachineToken `protobuf:"bytes,21,opt,name=luci_machine_token,json=luciMachineToken,proto3,oneof"`
}

type MintDelegationTokenRequest

type MintDelegationTokenRequest struct {
	// Identity whose authority is delegated.
	//
	// A string of the form "user:<email>" or a special token "REQUESTOR" that
	// means to delegate caller's own identity. The token server will check its
	// ACLs to make sure the caller is authorized to impersonate this identity.
	//
	// Required.
	DelegatedIdentity string `protobuf:"bytes,1,opt,name=delegated_identity,json=delegatedIdentity,proto3" json:"delegated_identity,omitempty"`
	// How long the token should be considered valid (in seconds).
	//
	// Default is 3600 sec.
	ValidityDuration int64 `protobuf:"varint,2,opt,name=validity_duration,json=validityDuration,proto3" json:"validity_duration,omitempty"`
	// Who will be able to use the new token.
	//
	// Each item can be an identity string (e.g. "user:<email>"), a "group:<name>"
	// string, special "*" string which means "Any bearer can use the token", or
	// "REQUESTOR" string which means "Whoever is making this call can use the
	// token".
	//
	// This is semantically is a set, the order of elements doesn't matter.
	//
	// Required.
	Audience []string `protobuf:"bytes,3,rep,name=audience,proto3" json:"audience,omitempty"`
	// What services should accept the new token.
	//
	// List of LUCI services (specified as service identities, e.g.
	// "service:app-id" or as https:// root URLs e.g. "https://<host>") that
	// should accept this token. May also contain special "*" string, which
	// means "All LUCI services".
	//
	// This is semantically is a set, the order of elements doesn't matter.
	//
	// Required.
	Services []string `protobuf:"bytes,4,rep,name=services,proto3" json:"services,omitempty"`
	// Optional reason why the token is created.
	//
	// Used only for logging and auditing purposes. Doesn't become part of the
	// token.
	Intent string `protobuf:"bytes,5,opt,name=intent,proto3" json:"intent,omitempty"`
	// Arbitrary key:value pairs embedded into the token by whoever requested it.
	// Convey circumstance of why the token is created.
	//
	// Services that accept the token may use them for additional authorization
	// decisions. Please use extremely carefully, only when you control both sides
	// of the delegation link and can guarantee that services involved understand
	// the tags.
	Tags                 []string `protobuf:"bytes,6,rep,name=tags,proto3" json:"tags,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MintDelegationTokenRequest is passed to MintDelegationToken.

func (*MintDelegationTokenRequest) Descriptor

func (*MintDelegationTokenRequest) Descriptor() ([]byte, []int)

func (*MintDelegationTokenRequest) GetAudience

func (m *MintDelegationTokenRequest) GetAudience() []string

func (*MintDelegationTokenRequest) GetDelegatedIdentity

func (m *MintDelegationTokenRequest) GetDelegatedIdentity() string

func (*MintDelegationTokenRequest) GetIntent

func (m *MintDelegationTokenRequest) GetIntent() string

func (*MintDelegationTokenRequest) GetServices

func (m *MintDelegationTokenRequest) GetServices() []string

func (*MintDelegationTokenRequest) GetTags

func (m *MintDelegationTokenRequest) GetTags() []string

func (*MintDelegationTokenRequest) GetValidityDuration

func (m *MintDelegationTokenRequest) GetValidityDuration() int64

func (*MintDelegationTokenRequest) ProtoMessage

func (*MintDelegationTokenRequest) ProtoMessage()

func (*MintDelegationTokenRequest) Reset

func (m *MintDelegationTokenRequest) Reset()

func (*MintDelegationTokenRequest) String

func (m *MintDelegationTokenRequest) String() string

func (*MintDelegationTokenRequest) XXX_DiscardUnknown

func (m *MintDelegationTokenRequest) XXX_DiscardUnknown()

func (*MintDelegationTokenRequest) XXX_Marshal

func (m *MintDelegationTokenRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MintDelegationTokenRequest) XXX_Merge

func (m *MintDelegationTokenRequest) XXX_Merge(src proto.Message)

func (*MintDelegationTokenRequest) XXX_Size

func (m *MintDelegationTokenRequest) XXX_Size() int

func (*MintDelegationTokenRequest) XXX_Unmarshal

func (m *MintDelegationTokenRequest) XXX_Unmarshal(b []byte) error

type MintDelegationTokenResponse

type MintDelegationTokenResponse struct {
	// The actual base64-encoded signed token.
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// Same data as in 'token' in deserialized form, just for convenience.
	//
	// Mostly for JSON encoding users, since they may not understand proto-encoded
	// tokens.
	DelegationSubtoken *messages.Subtoken `protobuf:"bytes,2,opt,name=delegation_subtoken,json=delegationSubtoken,proto3" json:"delegation_subtoken,omitempty"`
	// Identifier of the service and its version that produced the token.
	//
	// Has the form "<app-id>/<module-version>". This is _not_ part of the token.
	// Used only for logging and monitoring.
	ServiceVersion       string   `protobuf:"bytes,3,opt,name=service_version,json=serviceVersion,proto3" json:"service_version,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MintDelegationTokenResponse is returned by MintDelegationToken on success.

Errors are returned via standard gRPC codes.

func (*MintDelegationTokenResponse) Descriptor

func (*MintDelegationTokenResponse) Descriptor() ([]byte, []int)

func (*MintDelegationTokenResponse) GetDelegationSubtoken

func (m *MintDelegationTokenResponse) GetDelegationSubtoken() *messages.Subtoken

func (*MintDelegationTokenResponse) GetServiceVersion

func (m *MintDelegationTokenResponse) GetServiceVersion() string

func (*MintDelegationTokenResponse) GetToken

func (m *MintDelegationTokenResponse) GetToken() string

func (*MintDelegationTokenResponse) ProtoMessage

func (*MintDelegationTokenResponse) ProtoMessage()

func (*MintDelegationTokenResponse) Reset

func (m *MintDelegationTokenResponse) Reset()

func (*MintDelegationTokenResponse) String

func (m *MintDelegationTokenResponse) String() string

func (*MintDelegationTokenResponse) XXX_DiscardUnknown

func (m *MintDelegationTokenResponse) XXX_DiscardUnknown()

func (*MintDelegationTokenResponse) XXX_Marshal

func (m *MintDelegationTokenResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MintDelegationTokenResponse) XXX_Merge

func (m *MintDelegationTokenResponse) XXX_Merge(src proto.Message)

func (*MintDelegationTokenResponse) XXX_Size

func (m *MintDelegationTokenResponse) XXX_Size() int

func (*MintDelegationTokenResponse) XXX_Unmarshal

func (m *MintDelegationTokenResponse) XXX_Unmarshal(b []byte) error

type MintMachineTokenRequest

type MintMachineTokenRequest struct {
	SerializedTokenRequest []byte "" /* 129 byte string literal not displayed */

	Signature            []byte   `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MintMachineTokenRequest wraps a serialized and signed MachineTokenRequest message.

func (*MintMachineTokenRequest) Descriptor

func (*MintMachineTokenRequest) Descriptor() ([]byte, []int)

func (*MintMachineTokenRequest) GetSerializedTokenRequest

func (m *MintMachineTokenRequest) GetSerializedTokenRequest() []byte

func (*MintMachineTokenRequest) GetSignature

func (m *MintMachineTokenRequest) GetSignature() []byte

func (*MintMachineTokenRequest) ProtoMessage

func (*MintMachineTokenRequest) ProtoMessage()

func (*MintMachineTokenRequest) Reset

func (m *MintMachineTokenRequest) Reset()

func (*MintMachineTokenRequest) String

func (m *MintMachineTokenRequest) String() string

func (*MintMachineTokenRequest) XXX_DiscardUnknown

func (m *MintMachineTokenRequest) XXX_DiscardUnknown()

func (*MintMachineTokenRequest) XXX_Marshal

func (m *MintMachineTokenRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MintMachineTokenRequest) XXX_Merge

func (m *MintMachineTokenRequest) XXX_Merge(src proto.Message)

func (*MintMachineTokenRequest) XXX_Size

func (m *MintMachineTokenRequest) XXX_Size() int

func (*MintMachineTokenRequest) XXX_Unmarshal

func (m *MintMachineTokenRequest) XXX_Unmarshal(b []byte) error

type MintMachineTokenResponse

type MintMachineTokenResponse struct {
	// Possible kinds of fatal errors.
	//
	// Non fatal errors are returned as grpc.Internal errors instead.
	ErrorCode ErrorCode `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3,enum=tokenserver.minter.ErrorCode" json:"error_code,omitempty"`
	// Optional detailed error message.
	ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"`
	// On success (SUCCESS error code) contains the produced token.
	TokenResponse *MachineTokenResponse `protobuf:"bytes,3,opt,name=token_response,json=tokenResponse,proto3" json:"token_response,omitempty"`
	// Identifier of the service and its version that produced the response.
	//
	// Set for both successful responses and errors. On success, it is identical
	// to token_response.service_version.
	ServiceVersion       string   `protobuf:"bytes,4,opt,name=service_version,json=serviceVersion,proto3" json:"service_version,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MintMachineTokenResponse is returned by MintMachineToken if the server processed the request.

It's returned even if server refuses to mint a token. It contains the error details in that case.

func (*MintMachineTokenResponse) Descriptor

func (*MintMachineTokenResponse) Descriptor() ([]byte, []int)

func (*MintMachineTokenResponse) GetErrorCode

func (m *MintMachineTokenResponse) GetErrorCode() ErrorCode

func (*MintMachineTokenResponse) GetErrorMessage

func (m *MintMachineTokenResponse) GetErrorMessage() string

func (*MintMachineTokenResponse) GetServiceVersion

func (m *MintMachineTokenResponse) GetServiceVersion() string

func (*MintMachineTokenResponse) GetTokenResponse

func (m *MintMachineTokenResponse) GetTokenResponse() *MachineTokenResponse

func (*MintMachineTokenResponse) ProtoMessage

func (*MintMachineTokenResponse) ProtoMessage()

func (*MintMachineTokenResponse) Reset

func (m *MintMachineTokenResponse) Reset()

func (*MintMachineTokenResponse) String

func (m *MintMachineTokenResponse) String() string

func (*MintMachineTokenResponse) XXX_DiscardUnknown

func (m *MintMachineTokenResponse) XXX_DiscardUnknown()

func (*MintMachineTokenResponse) XXX_Marshal

func (m *MintMachineTokenResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MintMachineTokenResponse) XXX_Merge

func (m *MintMachineTokenResponse) XXX_Merge(src proto.Message)

func (*MintMachineTokenResponse) XXX_Size

func (m *MintMachineTokenResponse) XXX_Size() int

func (*MintMachineTokenResponse) XXX_Unmarshal

func (m *MintMachineTokenResponse) XXX_Unmarshal(b []byte) error

type MintOAuthTokenGrantRequest

type MintOAuthTokenGrantRequest struct {
	// Service account identity the end user wants to act as.
	//
	// A string of the form "<email>".
	//
	// Required.
	ServiceAccount string `protobuf:"bytes,1,opt,name=service_account,json=serviceAccount,proto3" json:"service_account,omitempty"`
	// How long the generated grant should be considered valid (in seconds).
	//
	// Default is 3600 sec.
	ValidityDuration int64 `protobuf:"varint,2,opt,name=validity_duration,json=validityDuration,proto3" json:"validity_duration,omitempty"`
	// An end user that wants to act as the service account (perhaps indirectly).
	//
	// A string of the form "user:<email>". On Swarming, this is an identity of
	// a user that posted the task.
	//
	// TODO(vadimsh): Verify that this user is present during MintOAuthTokenGrant
	// RPC by requiring the end user's credentials, e.g make Swarming forward
	// user's OAuth token to the token server, where it can be validated.
	//
	// Required.
	EndUser string `protobuf:"bytes,3,opt,name=end_user,json=endUser,proto3" json:"end_user,omitempty"`
	// Arbitrary key:value pairs describing circumstances of this call.
	//
	// Used only for logging and auditing purposes. Not involved in authorization
	// and don't become part of the grant.
	AuditTags            []string `protobuf:"bytes,4,rep,name=audit_tags,json=auditTags,proto3" json:"audit_tags,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MintOAuthTokenGrantRequest is passed to MintOAuthTokenGrant.

Additional implicit field is the identity of whoever makes this call. It becomes 'wielder_identity' of the generated token.

func (*MintOAuthTokenGrantRequest) Descriptor

func (*MintOAuthTokenGrantRequest) Descriptor() ([]byte, []int)

func (*MintOAuthTokenGrantRequest) GetAuditTags

func (m *MintOAuthTokenGrantRequest) GetAuditTags() []string

func (*MintOAuthTokenGrantRequest) GetEndUser

func (m *MintOAuthTokenGrantRequest) GetEndUser() string

func (*MintOAuthTokenGrantRequest) GetServiceAccount

func (m *MintOAuthTokenGrantRequest) GetServiceAccount() string

func (*MintOAuthTokenGrantRequest) GetValidityDuration

func (m *MintOAuthTokenGrantRequest) GetValidityDuration() int64

func (*MintOAuthTokenGrantRequest) ProtoMessage

func (*MintOAuthTokenGrantRequest) ProtoMessage()

func (*MintOAuthTokenGrantRequest) Reset

func (m *MintOAuthTokenGrantRequest) Reset()

func (*MintOAuthTokenGrantRequest) String

func (m *MintOAuthTokenGrantRequest) String() string

func (*MintOAuthTokenGrantRequest) XXX_DiscardUnknown

func (m *MintOAuthTokenGrantRequest) XXX_DiscardUnknown()

func (*MintOAuthTokenGrantRequest) XXX_Marshal

func (m *MintOAuthTokenGrantRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MintOAuthTokenGrantRequest) XXX_Merge

func (m *MintOAuthTokenGrantRequest) XXX_Merge(src proto.Message)

func (*MintOAuthTokenGrantRequest) XXX_Size

func (m *MintOAuthTokenGrantRequest) XXX_Size() int

func (*MintOAuthTokenGrantRequest) XXX_Unmarshal

func (m *MintOAuthTokenGrantRequest) XXX_Unmarshal(b []byte) error

type MintOAuthTokenGrantResponse

type MintOAuthTokenGrantResponse struct {
	GrantToken string               `protobuf:"bytes,1,opt,name=grant_token,json=grantToken,proto3" json:"grant_token,omitempty"`
	Expiry     *timestamp.Timestamp `protobuf:"bytes,2,opt,name=expiry,proto3" json:"expiry,omitempty"`
	// Identifier of the service and its version that produced the token.
	//
	// Has the form "<app-id>/<module-version>". This is _not_ part of the token.
	// Used only for logging and monitoring.
	ServiceVersion       string   `protobuf:"bytes,3,opt,name=service_version,json=serviceVersion,proto3" json:"service_version,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MintOAuthTokenGrantResponse is returned by MintOAuthTokenGrant.

func (*MintOAuthTokenGrantResponse) Descriptor

func (*MintOAuthTokenGrantResponse) Descriptor() ([]byte, []int)

func (*MintOAuthTokenGrantResponse) GetExpiry

func (m *MintOAuthTokenGrantResponse) GetExpiry() *timestamp.Timestamp

func (*MintOAuthTokenGrantResponse) GetGrantToken

func (m *MintOAuthTokenGrantResponse) GetGrantToken() string

func (*MintOAuthTokenGrantResponse) GetServiceVersion

func (m *MintOAuthTokenGrantResponse) GetServiceVersion() string

func (*MintOAuthTokenGrantResponse) ProtoMessage

func (*MintOAuthTokenGrantResponse) ProtoMessage()

func (*MintOAuthTokenGrantResponse) Reset

func (m *MintOAuthTokenGrantResponse) Reset()

func (*MintOAuthTokenGrantResponse) String

func (m *MintOAuthTokenGrantResponse) String() string

func (*MintOAuthTokenGrantResponse) XXX_DiscardUnknown

func (m *MintOAuthTokenGrantResponse) XXX_DiscardUnknown()

func (*MintOAuthTokenGrantResponse) XXX_Marshal

func (m *MintOAuthTokenGrantResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MintOAuthTokenGrantResponse) XXX_Merge

func (m *MintOAuthTokenGrantResponse) XXX_Merge(src proto.Message)

func (*MintOAuthTokenGrantResponse) XXX_Size

func (m *MintOAuthTokenGrantResponse) XXX_Size() int

func (*MintOAuthTokenGrantResponse) XXX_Unmarshal

func (m *MintOAuthTokenGrantResponse) XXX_Unmarshal(b []byte) error

type MintOAuthTokenViaGrantRequest

type MintOAuthTokenViaGrantRequest struct {
	// A previously generated grant, as returned by MintOAuthTokenGrant.
	GrantToken string `protobuf:"bytes,1,opt,name=grant_token,json=grantToken,proto3" json:"grant_token,omitempty"`
	// The list of OAuth scopes the access token should have.
	//
	// The server may reject the request if some scopes are not allowed.
	OauthScope []string `protobuf:"bytes,2,rep,name=oauth_scope,json=oauthScope,proto3" json:"oauth_scope,omitempty"`
	// Minimally accepted validity duration of the returned OAuth token (seconds).
	//
	// The server may return a token that lives longer than this. The maximum is
	// 1h. An attempt to get a token that lives longer than 1h will result in
	// an error.
	//
	// The returned token validity duration doesn't depend on the lifetime of
	// the grant: it's possible to use a grant that expires in 1 sec to get an
	// access token that lives for 1h.
	//
	// Default is 300 sec.
	MinValidityDuration int64 `protobuf:"varint,3,opt,name=min_validity_duration,json=minValidityDuration,proto3" json:"min_validity_duration,omitempty"`
	// Arbitrary key:value pairs describing circumstances of this call.
	//
	// Used only for logging and auditing purposes. Not involved in authorization.
	AuditTags            []string `protobuf:"bytes,4,rep,name=audit_tags,json=auditTags,proto3" json:"audit_tags,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MintOAuthTokenViaGrantRequest is passed to MintOAuthTokenViaGrant.

Additional implicit field is the identity of whoever makes this call. It is compared against 'wielder_identity' inside the token.

func (*MintOAuthTokenViaGrantRequest) Descriptor

func (*MintOAuthTokenViaGrantRequest) Descriptor() ([]byte, []int)

func (*MintOAuthTokenViaGrantRequest) GetAuditTags

func (m *MintOAuthTokenViaGrantRequest) GetAuditTags() []string

func (*MintOAuthTokenViaGrantRequest) GetGrantToken

func (m *MintOAuthTokenViaGrantRequest) GetGrantToken() string

func (*MintOAuthTokenViaGrantRequest) GetMinValidityDuration

func (m *MintOAuthTokenViaGrantRequest) GetMinValidityDuration() int64

func (*MintOAuthTokenViaGrantRequest) GetOauthScope

func (m *MintOAuthTokenViaGrantRequest) GetOauthScope() []string

func (*MintOAuthTokenViaGrantRequest) ProtoMessage

func (*MintOAuthTokenViaGrantRequest) ProtoMessage()

func (*MintOAuthTokenViaGrantRequest) Reset

func (m *MintOAuthTokenViaGrantRequest) Reset()

func (*MintOAuthTokenViaGrantRequest) String

func (m *MintOAuthTokenViaGrantRequest) String() string

func (*MintOAuthTokenViaGrantRequest) XXX_DiscardUnknown

func (m *MintOAuthTokenViaGrantRequest) XXX_DiscardUnknown()

func (*MintOAuthTokenViaGrantRequest) XXX_Marshal

func (m *MintOAuthTokenViaGrantRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MintOAuthTokenViaGrantRequest) XXX_Merge

func (m *MintOAuthTokenViaGrantRequest) XXX_Merge(src proto.Message)

func (*MintOAuthTokenViaGrantRequest) XXX_Size

func (m *MintOAuthTokenViaGrantRequest) XXX_Size() int

func (*MintOAuthTokenViaGrantRequest) XXX_Unmarshal

func (m *MintOAuthTokenViaGrantRequest) XXX_Unmarshal(b []byte) error

type MintOAuthTokenViaGrantResponse

type MintOAuthTokenViaGrantResponse struct {
	AccessToken string               `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
	Expiry      *timestamp.Timestamp `protobuf:"bytes,2,opt,name=expiry,proto3" json:"expiry,omitempty"`
	// Identifier of the service and its version that produced the token.
	//
	// Has the form "<app-id>/<module-version>". Used only for logging and
	// monitoring.
	ServiceVersion       string   `protobuf:"bytes,3,opt,name=service_version,json=serviceVersion,proto3" json:"service_version,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MintOAuthTokenViaGrantResponse is returned by MintOAuthTokenViaGrant.

func (*MintOAuthTokenViaGrantResponse) Descriptor

func (*MintOAuthTokenViaGrantResponse) Descriptor() ([]byte, []int)

func (*MintOAuthTokenViaGrantResponse) GetAccessToken

func (m *MintOAuthTokenViaGrantResponse) GetAccessToken() string

func (*MintOAuthTokenViaGrantResponse) GetExpiry

func (m *MintOAuthTokenViaGrantResponse) GetExpiry() *timestamp.Timestamp

func (*MintOAuthTokenViaGrantResponse) GetServiceVersion

func (m *MintOAuthTokenViaGrantResponse) GetServiceVersion() string

func (*MintOAuthTokenViaGrantResponse) ProtoMessage

func (*MintOAuthTokenViaGrantResponse) ProtoMessage()

func (*MintOAuthTokenViaGrantResponse) Reset

func (m *MintOAuthTokenViaGrantResponse) Reset()

func (*MintOAuthTokenViaGrantResponse) String

func (m *MintOAuthTokenViaGrantResponse) String() string

func (*MintOAuthTokenViaGrantResponse) XXX_DiscardUnknown

func (m *MintOAuthTokenViaGrantResponse) XXX_DiscardUnknown()

func (*MintOAuthTokenViaGrantResponse) XXX_Marshal

func (m *MintOAuthTokenViaGrantResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MintOAuthTokenViaGrantResponse) XXX_Merge

func (m *MintOAuthTokenViaGrantResponse) XXX_Merge(src proto.Message)

func (*MintOAuthTokenViaGrantResponse) XXX_Size

func (m *MintOAuthTokenViaGrantResponse) XXX_Size() int

func (*MintOAuthTokenViaGrantResponse) XXX_Unmarshal

func (m *MintOAuthTokenViaGrantResponse) XXX_Unmarshal(b []byte) error

type MintProjectTokenRequest

type MintProjectTokenRequest struct {
	// Luci project to which this token will be bound.
	LuciProject string `protobuf:"bytes,1,opt,name=luci_project,json=luciProject,proto3" json:"luci_project,omitempty"`
	// Requested OAuth scopes for the token.
	OauthScope []string `protobuf:"bytes,2,rep,name=oauth_scope,json=oauthScope,proto3" json:"oauth_scope,omitempty"`
	// Minimum token validity duration in seconds.
	MinValidityDuration int64 `protobuf:"varint,3,opt,name=min_validity_duration,json=minValidityDuration,proto3" json:"min_validity_duration,omitempty"`
	// Arbitrary key:value pairs describing circumstances of this call.
	//
	// Used only for logging and auditing purposes. Not involved in authorization.
	AuditTags            []string `protobuf:"bytes,4,rep,name=audit_tags,json=auditTags,proto3" json:"audit_tags,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MintProjectTokenRequest is passed to MintProjectToken.

func (*MintProjectTokenRequest) Descriptor

func (*MintProjectTokenRequest) Descriptor() ([]byte, []int)

func (*MintProjectTokenRequest) GetAuditTags

func (m *MintProjectTokenRequest) GetAuditTags() []string

func (*MintProjectTokenRequest) GetLuciProject

func (m *MintProjectTokenRequest) GetLuciProject() string

func (*MintProjectTokenRequest) GetMinValidityDuration

func (m *MintProjectTokenRequest) GetMinValidityDuration() int64

func (*MintProjectTokenRequest) GetOauthScope

func (m *MintProjectTokenRequest) GetOauthScope() []string

func (*MintProjectTokenRequest) ProtoMessage

func (*MintProjectTokenRequest) ProtoMessage()

func (*MintProjectTokenRequest) Reset

func (m *MintProjectTokenRequest) Reset()

func (*MintProjectTokenRequest) String

func (m *MintProjectTokenRequest) String() string

func (*MintProjectTokenRequest) XXX_DiscardUnknown

func (m *MintProjectTokenRequest) XXX_DiscardUnknown()

func (*MintProjectTokenRequest) XXX_Marshal

func (m *MintProjectTokenRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MintProjectTokenRequest) XXX_Merge

func (m *MintProjectTokenRequest) XXX_Merge(src proto.Message)

func (*MintProjectTokenRequest) XXX_Size

func (m *MintProjectTokenRequest) XXX_Size() int

func (*MintProjectTokenRequest) XXX_Unmarshal

func (m *MintProjectTokenRequest) XXX_Unmarshal(b []byte) error

type MintProjectTokenResponse

type MintProjectTokenResponse struct {
	// Full service account email.
	ServiceAccountEmail string `protobuf:"bytes,1,opt,name=service_account_email,json=serviceAccountEmail,proto3" json:"service_account_email,omitempty"`
	// OAuth access token.
	AccessToken string `protobuf:"bytes,2,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
	// Token expiration timestamp.
	Expiry *timestamp.Timestamp `protobuf:"bytes,3,opt,name=expiry,proto3" json:"expiry,omitempty"`
	// Identifier of the service and its version that produced the token.
	//
	// Has the form "<app-id>/<module-version>". Used only for logging and
	// monitoring.
	ServiceVersion       string   `protobuf:"bytes,4,opt,name=service_version,json=serviceVersion,proto3" json:"service_version,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MintProjectTokenResponse is returned by MintProjectToken.

func (*MintProjectTokenResponse) Descriptor

func (*MintProjectTokenResponse) Descriptor() ([]byte, []int)

func (*MintProjectTokenResponse) GetAccessToken

func (m *MintProjectTokenResponse) GetAccessToken() string

func (*MintProjectTokenResponse) GetExpiry

func (m *MintProjectTokenResponse) GetExpiry() *timestamp.Timestamp

func (*MintProjectTokenResponse) GetServiceAccountEmail

func (m *MintProjectTokenResponse) GetServiceAccountEmail() string

func (*MintProjectTokenResponse) GetServiceVersion

func (m *MintProjectTokenResponse) GetServiceVersion() string

func (*MintProjectTokenResponse) ProtoMessage

func (*MintProjectTokenResponse) ProtoMessage()

func (*MintProjectTokenResponse) Reset

func (m *MintProjectTokenResponse) Reset()

func (*MintProjectTokenResponse) String

func (m *MintProjectTokenResponse) String() string

func (*MintProjectTokenResponse) XXX_DiscardUnknown

func (m *MintProjectTokenResponse) XXX_DiscardUnknown()

func (*MintProjectTokenResponse) XXX_Marshal

func (m *MintProjectTokenResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MintProjectTokenResponse) XXX_Merge

func (m *MintProjectTokenResponse) XXX_Merge(src proto.Message)

func (*MintProjectTokenResponse) XXX_Size

func (m *MintProjectTokenResponse) XXX_Size() int

func (*MintProjectTokenResponse) XXX_Unmarshal

func (m *MintProjectTokenResponse) XXX_Unmarshal(b []byte) error

type MintServiceAccountTokenRequest

type MintServiceAccountTokenRequest struct {
	TokenKind ServiceAccountTokenKind "" /* 137 byte string literal not displayed */

	ServiceAccount string `protobuf:"bytes,2,opt,name=service_account,json=serviceAccount,proto3" json:"service_account,omitempty"`

	Realm string `protobuf:"bytes,3,opt,name=realm,proto3" json:"realm,omitempty"`

	OauthScope []string `protobuf:"bytes,4,rep,name=oauth_scope,json=oauthScope,proto3" json:"oauth_scope,omitempty"`

	IdTokenAudience string `protobuf:"bytes,5,opt,name=id_token_audience,json=idTokenAudience,proto3" json:"id_token_audience,omitempty"`

	MinValidityDuration int64 `protobuf:"varint,6,opt,name=min_validity_duration,json=minValidityDuration,proto3" json:"min_validity_duration,omitempty"`

	AuditTags            []string `protobuf:"bytes,7,rep,name=audit_tags,json=auditTags,proto3" json:"audit_tags,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MintServiceAccountTokenRequest is passed to MintServiceAccountToken.

func (*MintServiceAccountTokenRequest) Descriptor

func (*MintServiceAccountTokenRequest) Descriptor() ([]byte, []int)

func (*MintServiceAccountTokenRequest) GetAuditTags

func (m *MintServiceAccountTokenRequest) GetAuditTags() []string

func (*MintServiceAccountTokenRequest) GetIdTokenAudience

func (m *MintServiceAccountTokenRequest) GetIdTokenAudience() string

func (*MintServiceAccountTokenRequest) GetMinValidityDuration

func (m *MintServiceAccountTokenRequest) GetMinValidityDuration() int64

func (*MintServiceAccountTokenRequest) GetOauthScope

func (m *MintServiceAccountTokenRequest) GetOauthScope() []string

func (*MintServiceAccountTokenRequest) GetRealm

func (m *MintServiceAccountTokenRequest) GetRealm() string

func (*MintServiceAccountTokenRequest) GetServiceAccount

func (m *MintServiceAccountTokenRequest) GetServiceAccount() string

func (*MintServiceAccountTokenRequest) GetTokenKind

func (m *MintServiceAccountTokenRequest) GetTokenKind() ServiceAccountTokenKind

func (*MintServiceAccountTokenRequest) ProtoMessage

func (*MintServiceAccountTokenRequest) ProtoMessage()

func (*MintServiceAccountTokenRequest) Reset

func (m *MintServiceAccountTokenRequest) Reset()

func (*MintServiceAccountTokenRequest) String

func (m *MintServiceAccountTokenRequest) String() string

func (*MintServiceAccountTokenRequest) XXX_DiscardUnknown

func (m *MintServiceAccountTokenRequest) XXX_DiscardUnknown()

func (*MintServiceAccountTokenRequest) XXX_Marshal

func (m *MintServiceAccountTokenRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MintServiceAccountTokenRequest) XXX_Merge

func (m *MintServiceAccountTokenRequest) XXX_Merge(src proto.Message)

func (*MintServiceAccountTokenRequest) XXX_Size

func (m *MintServiceAccountTokenRequest) XXX_Size() int

func (*MintServiceAccountTokenRequest) XXX_Unmarshal

func (m *MintServiceAccountTokenRequest) XXX_Unmarshal(b []byte) error

type MintServiceAccountTokenResponse

type MintServiceAccountTokenResponse struct {
	Token  string               `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	Expiry *timestamp.Timestamp `protobuf:"bytes,2,opt,name=expiry,proto3" json:"expiry,omitempty"`
	// Identifier of the service and its version that produced the token.
	//
	// Has the form "<app-id>/<module-version>". Used only for logging and
	// monitoring.
	ServiceVersion       string   `protobuf:"bytes,3,opt,name=service_version,json=serviceVersion,proto3" json:"service_version,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

MintServiceAccountTokenResponse is returned by MintServiceAccountToken.

func (*MintServiceAccountTokenResponse) Descriptor

func (*MintServiceAccountTokenResponse) Descriptor() ([]byte, []int)

func (*MintServiceAccountTokenResponse) GetExpiry

func (m *MintServiceAccountTokenResponse) GetExpiry() *timestamp.Timestamp

func (*MintServiceAccountTokenResponse) GetServiceVersion

func (m *MintServiceAccountTokenResponse) GetServiceVersion() string

func (*MintServiceAccountTokenResponse) GetToken

func (m *MintServiceAccountTokenResponse) GetToken() string

func (*MintServiceAccountTokenResponse) ProtoMessage

func (*MintServiceAccountTokenResponse) ProtoMessage()

func (*MintServiceAccountTokenResponse) Reset

func (m *MintServiceAccountTokenResponse) Reset()

func (*MintServiceAccountTokenResponse) String

func (m *MintServiceAccountTokenResponse) String() string

func (*MintServiceAccountTokenResponse) XXX_DiscardUnknown

func (m *MintServiceAccountTokenResponse) XXX_DiscardUnknown()

func (*MintServiceAccountTokenResponse) XXX_Marshal

func (m *MintServiceAccountTokenResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MintServiceAccountTokenResponse) XXX_Merge

func (m *MintServiceAccountTokenResponse) XXX_Merge(src proto.Message)

func (*MintServiceAccountTokenResponse) XXX_Size

func (m *MintServiceAccountTokenResponse) XXX_Size() int

func (*MintServiceAccountTokenResponse) XXX_Unmarshal

func (m *MintServiceAccountTokenResponse) XXX_Unmarshal(b []byte) error

type ServiceAccountTokenKind

type ServiceAccountTokenKind int32

Used by MintServiceAccountToken.

const (
	ServiceAccountTokenKind_SERVICE_ACCOUNT_TOKEN_UNSPECIFIED  ServiceAccountTokenKind = 0
	ServiceAccountTokenKind_SERVICE_ACCOUNT_TOKEN_ACCESS_TOKEN ServiceAccountTokenKind = 1
	ServiceAccountTokenKind_SERVICE_ACCOUNT_TOKEN_ID_TOKEN     ServiceAccountTokenKind = 2
)

func (ServiceAccountTokenKind) EnumDescriptor

func (ServiceAccountTokenKind) EnumDescriptor() ([]byte, []int)

func (ServiceAccountTokenKind) String

func (x ServiceAccountTokenKind) String() string

type SignatureAlgorithm

type SignatureAlgorithm int32

Supported ways of singing the request.

const (
	SignatureAlgorithm_UNKNOWN_ALGO    SignatureAlgorithm = 0
	SignatureAlgorithm_SHA256_RSA_ALGO SignatureAlgorithm = 1
)

func (SignatureAlgorithm) EnumDescriptor

func (SignatureAlgorithm) EnumDescriptor() ([]byte, []int)

func (SignatureAlgorithm) String

func (x SignatureAlgorithm) String() string

type TokenMinterClient

type TokenMinterClient interface {
	// MintMachineToken generates a new token for an authenticated machine.
	//
	// It checks that provided certificate was signed by some trusted CA, and it
	// is still valid (non-expired and hasn't been revoked). It then checks that
	// the request was signed by the corresponding private key. Finally it checks
	// that the caller is authorized to generate requested kind of token.
	//
	// If everything checks out, it generates and returns a new machine token.
	//
	// On fatal error it returns detailed error response via same
	// MintMachineTokenResponse. On transient errors it returns generic
	// grpc.Internal error.
	MintMachineToken(ctx context.Context, in *MintMachineTokenRequest, opts ...grpc.CallOption) (*MintMachineTokenResponse, error)
	// MintDelegationToken generates a new bearer delegation token.
	//
	// Such token can be sent in 'X-Delegation-Token-V1' header (alongside regular
	// credentials like OAuth2 access token) to convey that the caller should be
	// authentication as 'delegated_identity' specified in the token.
	//
	// The delegation tokens are subject to multiple restrictions (embedded in
	// the token):
	//   * They have expiration time.
	//   * They are usable only if presented with a credential of someone from
	//     the 'audience' list.
	//   * They are usable only on services specified in the 'services' list.
	//
	// The token server must be configured in advance with all expected
	// combinations of (caller identity, delegated identity, audience, service)
	// tuples. See DelegationRule in config.proto.
	MintDelegationToken(ctx context.Context, in *MintDelegationTokenRequest, opts ...grpc.CallOption) (*MintDelegationTokenResponse, error)
	// MintOAuthTokenGrant generates a new grant for getting an OAuth2 token.
	//
	// This is a special (opaque for clients) token that asserts that the caller
	// at the time of the call was allowed to act as a particular service account
	// to perform a task authorized by an end-user.
	//
	// The returned grant can be used later (when the end-user is no longer
	// present) to get a real OAuth2 access token via MintOAuthTokenViaGrant call.
	//
	// This pair of RPCs is used to "delay" generation of service account OAuth
	// token until some later time, when it is actually needed. This is used by
	// Swarming:
	//   1. When the task is posted, Swarming calls MintOAuthTokenGrant to verify
	//      that the end-user is allowed to act as the requested service account
	//      on Swarming. On success, Swarming stores the grant in the task
	//      metadata.
	//   2. At a later time, when the task is executing and it needs an access
	//      token, Swarming calls MintOAuthTokenViaGrant to convert the grant into
	//      a real OAuth2 token.
	//
	// The returned grant can be used multiple times (as long as its validity
	// duration and the token server policy allows).
	//
	// The token server must be configured in advance with all expected
	// combinations of (caller identity, service account name, end users) tuples.
	// See ServiceAccountRule in config.proto.
	//
	// MintOAuthTokenGrant will check that the requested usage is allowed by the
	// rules. Later, MintOAuthTokenViaGrant will recheck this too.
	//
	// Note: in the process of being replaced with MintServiceAccountToken.
	MintOAuthTokenGrant(ctx context.Context, in *MintOAuthTokenGrantRequest, opts ...grpc.CallOption) (*MintOAuthTokenGrantResponse, error)
	// MintOAuthTokenViaGrant converts an OAuth2 token grant into an access token.
	//
	// The grant must be previously generated by MintOAuthTokenGrant function, see
	// its docs for more details.
	//
	// Note: in the process of being replaced with MintServiceAccountToken.
	MintOAuthTokenViaGrant(ctx context.Context, in *MintOAuthTokenViaGrantRequest, opts ...grpc.CallOption) (*MintOAuthTokenViaGrantResponse, error)
	// MintProjectToken mints an OAuth2 access token that represents an identity
	// associated with a LUCI project.
	//
	// Project-scoped tokens prevent accidental cross-project identity confusion
	// when LUCI services access project specific resources such as a source code
	// repository.
	MintProjectToken(ctx context.Context, in *MintProjectTokenRequest, opts ...grpc.CallOption) (*MintProjectTokenResponse, error)
	// MintServiceAccountToken mints an OAuth2 access token or OpenID ID token
	// that belongs to some service account using LUCI Realms for authorization.
	//
	// As an input it takes a service account email and a name of a LUCI Realm the
	// caller is operating in. To authorize the call the token server checks the
	// following conditions:
	//   1. The caller has luci.serviceAccounts.mintToken permission in the
	//      realm, allowing them to "impersonate" all service accounts belonging
	//      to this realm.
	//   2. The service account has luci.serviceAccounts.existInRealm permission
	//      in the realm. This makes the account "belong" to the realm.
	//   3. Realm's LUCI project has the service account associated with it in
	//      the project_owned_accounts.cfg global config file. This makes sure
	//      different LUCI projects can't just arbitrary use each others accounts
	//      by adding them to their respective realms.cfg. See also comments for
	//      ServiceAccountsProjectMapping in api/admin/v1/config.proto.
	MintServiceAccountToken(ctx context.Context, in *MintServiceAccountTokenRequest, opts ...grpc.CallOption) (*MintServiceAccountTokenResponse, error)
}

TokenMinterClient is the client API for TokenMinter service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewTokenMinterPRPCClient

func NewTokenMinterPRPCClient(client *prpc.Client) TokenMinterClient

type TokenMinterServer

type TokenMinterServer interface {
	// MintMachineToken generates a new token for an authenticated machine.
	//
	// It checks that provided certificate was signed by some trusted CA, and it
	// is still valid (non-expired and hasn't been revoked). It then checks that
	// the request was signed by the corresponding private key. Finally it checks
	// that the caller is authorized to generate requested kind of token.
	//
	// If everything checks out, it generates and returns a new machine token.
	//
	// On fatal error it returns detailed error response via same
	// MintMachineTokenResponse. On transient errors it returns generic
	// grpc.Internal error.
	MintMachineToken(context.Context, *MintMachineTokenRequest) (*MintMachineTokenResponse, error)
	// MintDelegationToken generates a new bearer delegation token.
	//
	// Such token can be sent in 'X-Delegation-Token-V1' header (alongside regular
	// credentials like OAuth2 access token) to convey that the caller should be
	// authentication as 'delegated_identity' specified in the token.
	//
	// The delegation tokens are subject to multiple restrictions (embedded in
	// the token):
	//   * They have expiration time.
	//   * They are usable only if presented with a credential of someone from
	//     the 'audience' list.
	//   * They are usable only on services specified in the 'services' list.
	//
	// The token server must be configured in advance with all expected
	// combinations of (caller identity, delegated identity, audience, service)
	// tuples. See DelegationRule in config.proto.
	MintDelegationToken(context.Context, *MintDelegationTokenRequest) (*MintDelegationTokenResponse, error)
	// MintOAuthTokenGrant generates a new grant for getting an OAuth2 token.
	//
	// This is a special (opaque for clients) token that asserts that the caller
	// at the time of the call was allowed to act as a particular service account
	// to perform a task authorized by an end-user.
	//
	// The returned grant can be used later (when the end-user is no longer
	// present) to get a real OAuth2 access token via MintOAuthTokenViaGrant call.
	//
	// This pair of RPCs is used to "delay" generation of service account OAuth
	// token until some later time, when it is actually needed. This is used by
	// Swarming:
	//   1. When the task is posted, Swarming calls MintOAuthTokenGrant to verify
	//      that the end-user is allowed to act as the requested service account
	//      on Swarming. On success, Swarming stores the grant in the task
	//      metadata.
	//   2. At a later time, when the task is executing and it needs an access
	//      token, Swarming calls MintOAuthTokenViaGrant to convert the grant into
	//      a real OAuth2 token.
	//
	// The returned grant can be used multiple times (as long as its validity
	// duration and the token server policy allows).
	//
	// The token server must be configured in advance with all expected
	// combinations of (caller identity, service account name, end users) tuples.
	// See ServiceAccountRule in config.proto.
	//
	// MintOAuthTokenGrant will check that the requested usage is allowed by the
	// rules. Later, MintOAuthTokenViaGrant will recheck this too.
	//
	// Note: in the process of being replaced with MintServiceAccountToken.
	MintOAuthTokenGrant(context.Context, *MintOAuthTokenGrantRequest) (*MintOAuthTokenGrantResponse, error)
	// MintOAuthTokenViaGrant converts an OAuth2 token grant into an access token.
	//
	// The grant must be previously generated by MintOAuthTokenGrant function, see
	// its docs for more details.
	//
	// Note: in the process of being replaced with MintServiceAccountToken.
	MintOAuthTokenViaGrant(context.Context, *MintOAuthTokenViaGrantRequest) (*MintOAuthTokenViaGrantResponse, error)
	// MintProjectToken mints an OAuth2 access token that represents an identity
	// associated with a LUCI project.
	//
	// Project-scoped tokens prevent accidental cross-project identity confusion
	// when LUCI services access project specific resources such as a source code
	// repository.
	MintProjectToken(context.Context, *MintProjectTokenRequest) (*MintProjectTokenResponse, error)
	// MintServiceAccountToken mints an OAuth2 access token or OpenID ID token
	// that belongs to some service account using LUCI Realms for authorization.
	//
	// As an input it takes a service account email and a name of a LUCI Realm the
	// caller is operating in. To authorize the call the token server checks the
	// following conditions:
	//   1. The caller has luci.serviceAccounts.mintToken permission in the
	//      realm, allowing them to "impersonate" all service accounts belonging
	//      to this realm.
	//   2. The service account has luci.serviceAccounts.existInRealm permission
	//      in the realm. This makes the account "belong" to the realm.
	//   3. Realm's LUCI project has the service account associated with it in
	//      the project_owned_accounts.cfg global config file. This makes sure
	//      different LUCI projects can't just arbitrary use each others accounts
	//      by adding them to their respective realms.cfg. See also comments for
	//      ServiceAccountsProjectMapping in api/admin/v1/config.proto.
	MintServiceAccountToken(context.Context, *MintServiceAccountTokenRequest) (*MintServiceAccountTokenResponse, error)
}

TokenMinterServer is the server API for TokenMinter service.

type UnimplementedTokenMinterServer

type UnimplementedTokenMinterServer struct {
}

UnimplementedTokenMinterServer can be embedded to have forward compatible implementations.

func (*UnimplementedTokenMinterServer) MintDelegationToken

func (*UnimplementedTokenMinterServer) MintDelegationToken(ctx context.Context, req *MintDelegationTokenRequest) (*MintDelegationTokenResponse, error)

func (*UnimplementedTokenMinterServer) MintMachineToken

func (*UnimplementedTokenMinterServer) MintMachineToken(ctx context.Context, req *MintMachineTokenRequest) (*MintMachineTokenResponse, error)

func (*UnimplementedTokenMinterServer) MintOAuthTokenGrant

func (*UnimplementedTokenMinterServer) MintOAuthTokenGrant(ctx context.Context, req *MintOAuthTokenGrantRequest) (*MintOAuthTokenGrantResponse, error)

func (*UnimplementedTokenMinterServer) MintOAuthTokenViaGrant

func (*UnimplementedTokenMinterServer) MintOAuthTokenViaGrant(ctx context.Context, req *MintOAuthTokenViaGrantRequest) (*MintOAuthTokenViaGrantResponse, error)

func (*UnimplementedTokenMinterServer) MintProjectToken

func (*UnimplementedTokenMinterServer) MintProjectToken(ctx context.Context, req *MintProjectTokenRequest) (*MintProjectTokenResponse, error)

func (*UnimplementedTokenMinterServer) MintServiceAccountToken

func (*UnimplementedTokenMinterServer) MintServiceAccountToken(ctx context.Context, req *MintServiceAccountTokenRequest) (*MintServiceAccountTokenResponse, error)

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier