luci: go.chromium.org/luci/tokenserver/api/minter/v1 Index | Files

package minter

import "go.chromium.org/luci/tokenserver/api/minter/v1"

Package minter contains the main API of the token server.

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

Index

Package Files

gen.go pb.discovery.go token_minter.pb.go token_minter_grpc.pb.go

Variables

var (
    SignatureAlgorithm_name = map[int32]string{
        0:  "UNKNOWN_ALGO",
        1:  "SHA256_RSA_ALGO",
    }
    SignatureAlgorithm_value = map[string]int32{
        "UNKNOWN_ALGO":    0,
        "SHA256_RSA_ALGO": 1,
    }
)

Enum value maps for SignatureAlgorithm.

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",
    }
    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,
    }
)

Enum value maps for ErrorCode.

var (
    ServiceAccountTokenKind_name = map[int32]string{
        0:  "SERVICE_ACCOUNT_TOKEN_UNSPECIFIED",
        1:  "SERVICE_ACCOUNT_TOKEN_ACCESS_TOKEN",
        2:  "SERVICE_ACCOUNT_TOKEN_ID_TOKEN",
    }
    ServiceAccountTokenKind_value = map[string]int32{
        "SERVICE_ACCOUNT_TOKEN_UNSPECIFIED":  0,
        "SERVICE_ACCOUNT_TOKEN_ACCESS_TOKEN": 1,
        "SERVICE_ACCOUNT_TOKEN_ID_TOKEN":     2,
    }
)

Enum value maps for ServiceAccountTokenKind.

var File_go_chromium_org_luci_tokenserver_api_minter_v1_token_minter_proto protoreflect.FileDescriptor
var TokenMinter_ServiceDesc = grpc.ServiceDesc{
    ServiceName: "tokenserver.minter.TokenMinter",
    HandlerType: (*TokenMinterServer)(nil),
    Methods: []grpc.MethodDesc{
        {
            MethodName: "MintMachineToken",
            Handler:    _TokenMinter_MintMachineToken_Handler,
        },
        {
            MethodName: "MintDelegationToken",
            Handler:    _TokenMinter_MintDelegationToken_Handler,
        },
        {
            MethodName: "MintOAuthTokenGrant",
            Handler:    _TokenMinter_MintOAuthTokenGrant_Handler,
        },
        {
            MethodName: "MintOAuthTokenViaGrant",
            Handler:    _TokenMinter_MintOAuthTokenViaGrant_Handler,
        },
        {
            MethodName: "MintProjectToken",
            Handler:    _TokenMinter_MintProjectToken_Handler,
        },
        {
            MethodName: "MintServiceAccountToken",
            Handler:    _TokenMinter_MintServiceAccountToken_Handler,
        },
    },
    Streams:  []grpc.StreamDesc{},
    Metadata: "go.chromium.org/luci/tokenserver/api/minter/v1/token_minter.proto",
}

TokenMinter_ServiceDesc is the grpc.ServiceDesc for TokenMinter service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

func FileDescriptorSet Uses

func FileDescriptorSet() *descriptorpb.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 Uses

func RegisterTokenMinterServer(s grpc.ServiceRegistrar, srv TokenMinterServer)

type ErrorCode Uses

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 // used signature_algorithm is not supported
    ErrorCode_UNSUPPORTED_TOKEN_TYPE      ErrorCode = 2 // requested token_type is not supported
    ErrorCode_BAD_TIMESTAMP               ErrorCode = 3 // issued_at field is wrong
    ErrorCode_BAD_CERTIFICATE_FORMAT      ErrorCode = 4 // malformed or unsupported certificate
    ErrorCode_BAD_SIGNATURE               ErrorCode = 5 // signature doesn't match or can't be verified
    ErrorCode_UNTRUSTED_CERTIFICATE       ErrorCode = 6 // invalid certificate or can't verify it yet
    ErrorCode_BAD_TOKEN_ARGUMENTS         ErrorCode = 7 // FQDN or Scopes are invalid or not whitelisted
    ErrorCode_MACHINE_TOKEN_MINTING_ERROR ErrorCode = 8 // unspecified fatal error when minting a machine token
)

func (ErrorCode) Descriptor Uses

func (ErrorCode) Descriptor() protoreflect.EnumDescriptor

func (ErrorCode) Enum Uses

func (x ErrorCode) Enum() *ErrorCode

func (ErrorCode) EnumDescriptor Uses

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

Deprecated: Use ErrorCode.Descriptor instead.

func (ErrorCode) Number Uses

func (x ErrorCode) Number() protoreflect.EnumNumber

func (ErrorCode) String Uses

func (x ErrorCode) String() string

func (ErrorCode) Type Uses

func (ErrorCode) Type() protoreflect.EnumType

type LuciMachineToken Uses

type LuciMachineToken struct {
    MachineToken string                 `protobuf:"bytes,1,opt,name=machine_token,json=machineToken,proto3" json:"machine_token,omitempty"` // the actual token
    Expiry       *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=expiry,proto3" json:"expiry,omitempty"`                                 // when the token expires
    // contains filtered or unexported fields
}

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 Uses

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

Deprecated: Use LuciMachineToken.ProtoReflect.Descriptor instead.

func (*LuciMachineToken) GetExpiry Uses

func (x *LuciMachineToken) GetExpiry() *timestamppb.Timestamp

func (*LuciMachineToken) GetMachineToken Uses

func (x *LuciMachineToken) GetMachineToken() string

func (*LuciMachineToken) ProtoMessage Uses

func (*LuciMachineToken) ProtoMessage()

func (*LuciMachineToken) ProtoReflect Uses

func (x *LuciMachineToken) ProtoReflect() protoreflect.Message

func (*LuciMachineToken) Reset Uses

func (x *LuciMachineToken) Reset()

func (*LuciMachineToken) String Uses

func (x *LuciMachineToken) String() string

type MachineTokenRequest Uses

type MachineTokenRequest struct {

    // The certificate that identifies a caller (as ASN1-serialized blob).
    //
    // It will be used to extract machine FQDN (it's CN of the cert) and CA name
    // to use to check the cert.
    Certificate []byte `protobuf:"bytes,1,opt,name=certificate,proto3" json:"certificate,omitempty"`
    // The signature algorithm used to sign this request.
    //
    // Defines what's in MintMachineTokenRequest.signature field.
    SignatureAlgorithm SignatureAlgorithm `protobuf:"varint,2,opt,name=signature_algorithm,json=signatureAlgorithm,proto3,enum=tokenserver.minter.SignatureAlgorithm" json:"signature_algorithm,omitempty"`
    // Timestamp when this request was created, by the issuer clock.
    IssuedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=issued_at,json=issuedAt,proto3" json:"issued_at,omitempty"`
    // The token type being requested.
    //
    // Defines what fields of the response are set.
    TokenType api.MachineTokenType `protobuf:"varint,4,opt,name=token_type,json=tokenType,proto3,enum=tokenserver.MachineTokenType" json:"token_type,omitempty"`
    // contains filtered or unexported fields
}

MachineTokenRequest contains the actual request parameters.

func (*MachineTokenRequest) Descriptor Uses

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

Deprecated: Use MachineTokenRequest.ProtoReflect.Descriptor instead.

func (*MachineTokenRequest) GetCertificate Uses

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

func (*MachineTokenRequest) GetIssuedAt Uses

func (x *MachineTokenRequest) GetIssuedAt() *timestamppb.Timestamp

func (*MachineTokenRequest) GetSignatureAlgorithm Uses

func (x *MachineTokenRequest) GetSignatureAlgorithm() SignatureAlgorithm

func (*MachineTokenRequest) GetTokenType Uses

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

func (*MachineTokenRequest) ProtoMessage Uses

func (*MachineTokenRequest) ProtoMessage()

func (*MachineTokenRequest) ProtoReflect Uses

func (x *MachineTokenRequest) ProtoReflect() protoreflect.Message

func (*MachineTokenRequest) Reset Uses

func (x *MachineTokenRequest) Reset()

func (*MachineTokenRequest) String Uses

func (x *MachineTokenRequest) String() string

type MachineTokenResponse Uses

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 assignable to TokenType:
    //	*MachineTokenResponse_LuciMachineToken
    TokenType isMachineTokenResponse_TokenType `protobuf_oneof:"token_type"`
    // contains filtered or unexported fields
}

MachineTokenResponse contains a token requested by MachineTokenRequest.

func (*MachineTokenResponse) Descriptor Uses

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

Deprecated: Use MachineTokenResponse.ProtoReflect.Descriptor instead.

func (*MachineTokenResponse) GetLuciMachineToken Uses

func (x *MachineTokenResponse) GetLuciMachineToken() *LuciMachineToken

func (*MachineTokenResponse) GetServiceVersion Uses

func (x *MachineTokenResponse) GetServiceVersion() string

func (*MachineTokenResponse) GetTokenType Uses

func (m *MachineTokenResponse) GetTokenType() isMachineTokenResponse_TokenType

func (*MachineTokenResponse) ProtoMessage Uses

func (*MachineTokenResponse) ProtoMessage()

func (*MachineTokenResponse) ProtoReflect Uses

func (x *MachineTokenResponse) ProtoReflect() protoreflect.Message

func (*MachineTokenResponse) Reset Uses

func (x *MachineTokenResponse) Reset()

func (*MachineTokenResponse) String Uses

func (x *MachineTokenResponse) String() string

type MachineTokenResponse_LuciMachineToken Uses

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

type MintDelegationTokenRequest Uses

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"`
    // contains filtered or unexported fields
}

MintDelegationTokenRequest is passed to MintDelegationToken.

func (*MintDelegationTokenRequest) Descriptor Uses

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

Deprecated: Use MintDelegationTokenRequest.ProtoReflect.Descriptor instead.

func (*MintDelegationTokenRequest) GetAudience Uses

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

func (*MintDelegationTokenRequest) GetDelegatedIdentity Uses

func (x *MintDelegationTokenRequest) GetDelegatedIdentity() string

func (*MintDelegationTokenRequest) GetIntent Uses

func (x *MintDelegationTokenRequest) GetIntent() string

func (*MintDelegationTokenRequest) GetServices Uses

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

func (*MintDelegationTokenRequest) GetTags Uses

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

func (*MintDelegationTokenRequest) GetValidityDuration Uses

func (x *MintDelegationTokenRequest) GetValidityDuration() int64

func (*MintDelegationTokenRequest) ProtoMessage Uses

func (*MintDelegationTokenRequest) ProtoMessage()

func (*MintDelegationTokenRequest) ProtoReflect Uses

func (x *MintDelegationTokenRequest) ProtoReflect() protoreflect.Message

func (*MintDelegationTokenRequest) Reset Uses

func (x *MintDelegationTokenRequest) Reset()

func (*MintDelegationTokenRequest) String Uses

func (x *MintDelegationTokenRequest) String() string

type MintDelegationTokenResponse Uses

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"`
    // contains filtered or unexported fields
}

MintDelegationTokenResponse is returned by MintDelegationToken on success.

Errors are returned via standard gRPC codes.

func (*MintDelegationTokenResponse) Descriptor Uses

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

Deprecated: Use MintDelegationTokenResponse.ProtoReflect.Descriptor instead.

func (*MintDelegationTokenResponse) GetDelegationSubtoken Uses

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

func (*MintDelegationTokenResponse) GetServiceVersion Uses

func (x *MintDelegationTokenResponse) GetServiceVersion() string

func (*MintDelegationTokenResponse) GetToken Uses

func (x *MintDelegationTokenResponse) GetToken() string

func (*MintDelegationTokenResponse) ProtoMessage Uses

func (*MintDelegationTokenResponse) ProtoMessage()

func (*MintDelegationTokenResponse) ProtoReflect Uses

func (x *MintDelegationTokenResponse) ProtoReflect() protoreflect.Message

func (*MintDelegationTokenResponse) Reset Uses

func (x *MintDelegationTokenResponse) Reset()

func (*MintDelegationTokenResponse) String Uses

func (x *MintDelegationTokenResponse) String() string

type MintMachineTokenRequest Uses

type MintMachineTokenRequest struct {

    // The protobuf-serialized MachineTokenRequest message, signed by the private
    // key that matches MachineTokenRequest.certificate.
    //
    // We have to send it as a byte blob to avoid dealing with possible protobuf
    // serialization inconsistencies when checking the signature.
    SerializedTokenRequest []byte `protobuf:"bytes,1,opt,name=serialized_token_request,json=serializedTokenRequest,proto3" json:"serialized_token_request,omitempty"`
    // The signature of 'serialized_token_parameters' blob.
    //
    // See MachineTokenRequest.signature_algorithm for exact meaning.
    Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
    // contains filtered or unexported fields
}

MintMachineTokenRequest wraps a serialized and signed MachineTokenRequest message.

func (*MintMachineTokenRequest) Descriptor Uses

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

Deprecated: Use MintMachineTokenRequest.ProtoReflect.Descriptor instead.

func (*MintMachineTokenRequest) GetSerializedTokenRequest Uses

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

func (*MintMachineTokenRequest) GetSignature Uses

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

func (*MintMachineTokenRequest) ProtoMessage Uses

func (*MintMachineTokenRequest) ProtoMessage()

func (*MintMachineTokenRequest) ProtoReflect Uses

func (x *MintMachineTokenRequest) ProtoReflect() protoreflect.Message

func (*MintMachineTokenRequest) Reset Uses

func (x *MintMachineTokenRequest) Reset()

func (*MintMachineTokenRequest) String Uses

func (x *MintMachineTokenRequest) String() string

type MintMachineTokenResponse Uses

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"`
    // contains filtered or unexported fields
}

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 Uses

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

Deprecated: Use MintMachineTokenResponse.ProtoReflect.Descriptor instead.

func (*MintMachineTokenResponse) GetErrorCode Uses

func (x *MintMachineTokenResponse) GetErrorCode() ErrorCode

func (*MintMachineTokenResponse) GetErrorMessage Uses

func (x *MintMachineTokenResponse) GetErrorMessage() string

func (*MintMachineTokenResponse) GetServiceVersion Uses

func (x *MintMachineTokenResponse) GetServiceVersion() string

func (*MintMachineTokenResponse) GetTokenResponse Uses

func (x *MintMachineTokenResponse) GetTokenResponse() *MachineTokenResponse

func (*MintMachineTokenResponse) ProtoMessage Uses

func (*MintMachineTokenResponse) ProtoMessage()

func (*MintMachineTokenResponse) ProtoReflect Uses

func (x *MintMachineTokenResponse) ProtoReflect() protoreflect.Message

func (*MintMachineTokenResponse) Reset Uses

func (x *MintMachineTokenResponse) Reset()

func (*MintMachineTokenResponse) String Uses

func (x *MintMachineTokenResponse) String() string

type MintOAuthTokenGrantRequest Uses

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"`
    // contains filtered or unexported fields
}

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 Uses

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

Deprecated: Use MintOAuthTokenGrantRequest.ProtoReflect.Descriptor instead.

func (*MintOAuthTokenGrantRequest) GetAuditTags Uses

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

func (*MintOAuthTokenGrantRequest) GetEndUser Uses

func (x *MintOAuthTokenGrantRequest) GetEndUser() string

func (*MintOAuthTokenGrantRequest) GetServiceAccount Uses

func (x *MintOAuthTokenGrantRequest) GetServiceAccount() string

func (*MintOAuthTokenGrantRequest) GetValidityDuration Uses

func (x *MintOAuthTokenGrantRequest) GetValidityDuration() int64

func (*MintOAuthTokenGrantRequest) ProtoMessage Uses

func (*MintOAuthTokenGrantRequest) ProtoMessage()

func (*MintOAuthTokenGrantRequest) ProtoReflect Uses

func (x *MintOAuthTokenGrantRequest) ProtoReflect() protoreflect.Message

func (*MintOAuthTokenGrantRequest) Reset Uses

func (x *MintOAuthTokenGrantRequest) Reset()

func (*MintOAuthTokenGrantRequest) String Uses

func (x *MintOAuthTokenGrantRequest) String() string

type MintOAuthTokenGrantResponse Uses

type MintOAuthTokenGrantResponse struct {
    GrantToken string                 `protobuf:"bytes,1,opt,name=grant_token,json=grantToken,proto3" json:"grant_token,omitempty"` // an opaque urlsafe token
    Expiry     *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=expiry,proto3" json:"expiry,omitempty"`                           // when this token expires
    // 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"`
    // contains filtered or unexported fields
}

MintOAuthTokenGrantResponse is returned by MintOAuthTokenGrant.

func (*MintOAuthTokenGrantResponse) Descriptor Uses

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

Deprecated: Use MintOAuthTokenGrantResponse.ProtoReflect.Descriptor instead.

func (*MintOAuthTokenGrantResponse) GetExpiry Uses

func (x *MintOAuthTokenGrantResponse) GetExpiry() *timestamppb.Timestamp

func (*MintOAuthTokenGrantResponse) GetGrantToken Uses

func (x *MintOAuthTokenGrantResponse) GetGrantToken() string

func (*MintOAuthTokenGrantResponse) GetServiceVersion Uses

func (x *MintOAuthTokenGrantResponse) GetServiceVersion() string

func (*MintOAuthTokenGrantResponse) ProtoMessage Uses

func (*MintOAuthTokenGrantResponse) ProtoMessage()

func (*MintOAuthTokenGrantResponse) ProtoReflect Uses

func (x *MintOAuthTokenGrantResponse) ProtoReflect() protoreflect.Message

func (*MintOAuthTokenGrantResponse) Reset Uses

func (x *MintOAuthTokenGrantResponse) Reset()

func (*MintOAuthTokenGrantResponse) String Uses

func (x *MintOAuthTokenGrantResponse) String() string

type MintOAuthTokenViaGrantRequest Uses

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"`
    // contains filtered or unexported fields
}

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 Uses

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

Deprecated: Use MintOAuthTokenViaGrantRequest.ProtoReflect.Descriptor instead.

func (*MintOAuthTokenViaGrantRequest) GetAuditTags Uses

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

func (*MintOAuthTokenViaGrantRequest) GetGrantToken Uses

func (x *MintOAuthTokenViaGrantRequest) GetGrantToken() string

func (*MintOAuthTokenViaGrantRequest) GetMinValidityDuration Uses

func (x *MintOAuthTokenViaGrantRequest) GetMinValidityDuration() int64

func (*MintOAuthTokenViaGrantRequest) GetOauthScope Uses

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

func (*MintOAuthTokenViaGrantRequest) ProtoMessage Uses

func (*MintOAuthTokenViaGrantRequest) ProtoMessage()

func (*MintOAuthTokenViaGrantRequest) ProtoReflect Uses

func (x *MintOAuthTokenViaGrantRequest) ProtoReflect() protoreflect.Message

func (*MintOAuthTokenViaGrantRequest) Reset Uses

func (x *MintOAuthTokenViaGrantRequest) Reset()

func (*MintOAuthTokenViaGrantRequest) String Uses

func (x *MintOAuthTokenViaGrantRequest) String() string

type MintOAuthTokenViaGrantResponse Uses

type MintOAuthTokenViaGrantResponse struct {
    AccessToken string                 `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` // service account OAuth2 access token
    Expiry      *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=expiry,proto3" json:"expiry,omitempty"`                              // when this token expires
    // 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"`
    // contains filtered or unexported fields
}

MintOAuthTokenViaGrantResponse is returned by MintOAuthTokenViaGrant.

func (*MintOAuthTokenViaGrantResponse) Descriptor Uses

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

Deprecated: Use MintOAuthTokenViaGrantResponse.ProtoReflect.Descriptor instead.

func (*MintOAuthTokenViaGrantResponse) GetAccessToken Uses

func (x *MintOAuthTokenViaGrantResponse) GetAccessToken() string

func (*MintOAuthTokenViaGrantResponse) GetExpiry Uses

func (x *MintOAuthTokenViaGrantResponse) GetExpiry() *timestamppb.Timestamp

func (*MintOAuthTokenViaGrantResponse) GetServiceVersion Uses

func (x *MintOAuthTokenViaGrantResponse) GetServiceVersion() string

func (*MintOAuthTokenViaGrantResponse) ProtoMessage Uses

func (*MintOAuthTokenViaGrantResponse) ProtoMessage()

func (*MintOAuthTokenViaGrantResponse) ProtoReflect Uses

func (x *MintOAuthTokenViaGrantResponse) ProtoReflect() protoreflect.Message

func (*MintOAuthTokenViaGrantResponse) Reset Uses

func (x *MintOAuthTokenViaGrantResponse) Reset()

func (*MintOAuthTokenViaGrantResponse) String Uses

func (x *MintOAuthTokenViaGrantResponse) String() string

type MintProjectTokenRequest Uses

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"`
    // contains filtered or unexported fields
}

MintProjectTokenRequest is passed to MintProjectToken.

func (*MintProjectTokenRequest) Descriptor Uses

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

Deprecated: Use MintProjectTokenRequest.ProtoReflect.Descriptor instead.

func (*MintProjectTokenRequest) GetAuditTags Uses

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

func (*MintProjectTokenRequest) GetLuciProject Uses

func (x *MintProjectTokenRequest) GetLuciProject() string

func (*MintProjectTokenRequest) GetMinValidityDuration Uses

func (x *MintProjectTokenRequest) GetMinValidityDuration() int64

func (*MintProjectTokenRequest) GetOauthScope Uses

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

func (*MintProjectTokenRequest) ProtoMessage Uses

func (*MintProjectTokenRequest) ProtoMessage()

func (*MintProjectTokenRequest) ProtoReflect Uses

func (x *MintProjectTokenRequest) ProtoReflect() protoreflect.Message

func (*MintProjectTokenRequest) Reset Uses

func (x *MintProjectTokenRequest) Reset()

func (*MintProjectTokenRequest) String Uses

func (x *MintProjectTokenRequest) String() string

type MintProjectTokenResponse Uses

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 *timestamppb.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"`
    // contains filtered or unexported fields
}

MintProjectTokenResponse is returned by MintProjectToken.

func (*MintProjectTokenResponse) Descriptor Uses

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

Deprecated: Use MintProjectTokenResponse.ProtoReflect.Descriptor instead.

func (*MintProjectTokenResponse) GetAccessToken Uses

func (x *MintProjectTokenResponse) GetAccessToken() string

func (*MintProjectTokenResponse) GetExpiry Uses

func (x *MintProjectTokenResponse) GetExpiry() *timestamppb.Timestamp

func (*MintProjectTokenResponse) GetServiceAccountEmail Uses

func (x *MintProjectTokenResponse) GetServiceAccountEmail() string

func (*MintProjectTokenResponse) GetServiceVersion Uses

func (x *MintProjectTokenResponse) GetServiceVersion() string

func (*MintProjectTokenResponse) ProtoMessage Uses

func (*MintProjectTokenResponse) ProtoMessage()

func (*MintProjectTokenResponse) ProtoReflect Uses

func (x *MintProjectTokenResponse) ProtoReflect() protoreflect.Message

func (*MintProjectTokenResponse) Reset Uses

func (x *MintProjectTokenResponse) Reset()

func (*MintProjectTokenResponse) String Uses

func (x *MintProjectTokenResponse) String() string

type MintServiceAccountTokenRequest Uses

type MintServiceAccountTokenRequest struct {

    // What kind of a token is being requested. Required.
    TokenKind ServiceAccountTokenKind `protobuf:"varint,1,opt,name=token_kind,json=tokenKind,proto3,enum=tokenserver.minter.ServiceAccountTokenKind" json:"token_kind,omitempty"`
    // Email of a service account to grab the token for. Required.
    ServiceAccount string `protobuf:"bytes,2,opt,name=service_account,json=serviceAccount,proto3" json:"service_account,omitempty"`
    // A LUCI realm to use to authorize the call. Required.
    Realm string `protobuf:"bytes,3,opt,name=realm,proto3" json:"realm,omitempty"`
    // A list of scopes the OAuth2 access token should have.
    //
    // Must be set if token_kind is SERVICE_ACCOUNT_TOKEN_ACCESS_TOKEN and must
    // be empty otherwise.
    OauthScope []string `protobuf:"bytes,4,rep,name=oauth_scope,json=oauthScope,proto3" json:"oauth_scope,omitempty"`
    // An audience the ID token should have.
    //
    // Must be set if token_kind is SERVICE_ACCOUNT_TOKEN_ID_TOKEN and must
    // be empty otherwise.
    IdTokenAudience string `protobuf:"bytes,5,opt,name=id_token_audience,json=idTokenAudience,proto3" json:"id_token_audience,omitempty"`
    // Minimally accepted validity duration of the returned 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.
    //
    // Default is 300 sec.
    MinValidityDuration int64 `protobuf:"varint,6,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,7,rep,name=audit_tags,json=auditTags,proto3" json:"audit_tags,omitempty"`
    // contains filtered or unexported fields
}

MintServiceAccountTokenRequest is passed to MintServiceAccountToken.

func (*MintServiceAccountTokenRequest) Descriptor Uses

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

Deprecated: Use MintServiceAccountTokenRequest.ProtoReflect.Descriptor instead.

func (*MintServiceAccountTokenRequest) GetAuditTags Uses

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

func (*MintServiceAccountTokenRequest) GetIdTokenAudience Uses

func (x *MintServiceAccountTokenRequest) GetIdTokenAudience() string

func (*MintServiceAccountTokenRequest) GetMinValidityDuration Uses

func (x *MintServiceAccountTokenRequest) GetMinValidityDuration() int64

func (*MintServiceAccountTokenRequest) GetOauthScope Uses

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

func (*MintServiceAccountTokenRequest) GetRealm Uses

func (x *MintServiceAccountTokenRequest) GetRealm() string

func (*MintServiceAccountTokenRequest) GetServiceAccount Uses

func (x *MintServiceAccountTokenRequest) GetServiceAccount() string

func (*MintServiceAccountTokenRequest) GetTokenKind Uses

func (x *MintServiceAccountTokenRequest) GetTokenKind() ServiceAccountTokenKind

func (*MintServiceAccountTokenRequest) ProtoMessage Uses

func (*MintServiceAccountTokenRequest) ProtoMessage()

func (*MintServiceAccountTokenRequest) ProtoReflect Uses

func (x *MintServiceAccountTokenRequest) ProtoReflect() protoreflect.Message

func (*MintServiceAccountTokenRequest) Reset Uses

func (x *MintServiceAccountTokenRequest) Reset()

func (*MintServiceAccountTokenRequest) String Uses

func (x *MintServiceAccountTokenRequest) String() string

type MintServiceAccountTokenResponse Uses

type MintServiceAccountTokenResponse struct {
    Token  string                 `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`   // the produced token
    Expiry *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=expiry,proto3" json:"expiry,omitempty"` // when this token expires
    // 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"`
    // contains filtered or unexported fields
}

MintServiceAccountTokenResponse is returned by MintServiceAccountToken.

func (*MintServiceAccountTokenResponse) Descriptor Uses

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

Deprecated: Use MintServiceAccountTokenResponse.ProtoReflect.Descriptor instead.

func (*MintServiceAccountTokenResponse) GetExpiry Uses

func (x *MintServiceAccountTokenResponse) GetExpiry() *timestamppb.Timestamp

func (*MintServiceAccountTokenResponse) GetServiceVersion Uses

func (x *MintServiceAccountTokenResponse) GetServiceVersion() string

func (*MintServiceAccountTokenResponse) GetToken Uses

func (x *MintServiceAccountTokenResponse) GetToken() string

func (*MintServiceAccountTokenResponse) ProtoMessage Uses

func (*MintServiceAccountTokenResponse) ProtoMessage()

func (*MintServiceAccountTokenResponse) ProtoReflect Uses

func (x *MintServiceAccountTokenResponse) ProtoReflect() protoreflect.Message

func (*MintServiceAccountTokenResponse) Reset Uses

func (x *MintServiceAccountTokenResponse) Reset()

func (*MintServiceAccountTokenResponse) String Uses

func (x *MintServiceAccountTokenResponse) String() string

type ServiceAccountTokenKind Uses

type ServiceAccountTokenKind int32

Used by MintServiceAccountToken.

const (
    ServiceAccountTokenKind_SERVICE_ACCOUNT_TOKEN_UNSPECIFIED  ServiceAccountTokenKind = 0
    ServiceAccountTokenKind_SERVICE_ACCOUNT_TOKEN_ACCESS_TOKEN ServiceAccountTokenKind = 1 // ask for an OAuth2 access token
    ServiceAccountTokenKind_SERVICE_ACCOUNT_TOKEN_ID_TOKEN     ServiceAccountTokenKind = 2 // ask for an OpenID ID token
)

func (ServiceAccountTokenKind) Descriptor Uses

func (ServiceAccountTokenKind) Descriptor() protoreflect.EnumDescriptor

func (ServiceAccountTokenKind) Enum Uses

func (x ServiceAccountTokenKind) Enum() *ServiceAccountTokenKind

func (ServiceAccountTokenKind) EnumDescriptor Uses

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

Deprecated: Use ServiceAccountTokenKind.Descriptor instead.

func (ServiceAccountTokenKind) Number Uses

func (x ServiceAccountTokenKind) Number() protoreflect.EnumNumber

func (ServiceAccountTokenKind) String Uses

func (x ServiceAccountTokenKind) String() string

func (ServiceAccountTokenKind) Type Uses

func (ServiceAccountTokenKind) Type() protoreflect.EnumType

type SignatureAlgorithm Uses

type SignatureAlgorithm int32

Supported ways of singing the request.

const (
    SignatureAlgorithm_UNKNOWN_ALGO    SignatureAlgorithm = 0 // used if the field is not initialized
    SignatureAlgorithm_SHA256_RSA_ALGO SignatureAlgorithm = 1 // matches x509's sha256WithRSAEncryption
)

func (SignatureAlgorithm) Descriptor Uses

func (SignatureAlgorithm) Descriptor() protoreflect.EnumDescriptor

func (SignatureAlgorithm) Enum Uses

func (x SignatureAlgorithm) Enum() *SignatureAlgorithm

func (SignatureAlgorithm) EnumDescriptor Uses

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

Deprecated: Use SignatureAlgorithm.Descriptor instead.

func (SignatureAlgorithm) Number Uses

func (x SignatureAlgorithm) Number() protoreflect.EnumNumber

func (SignatureAlgorithm) String Uses

func (x SignatureAlgorithm) String() string

func (SignatureAlgorithm) Type Uses

func (SignatureAlgorithm) Type() protoreflect.EnumType

type TokenMinterClient Uses

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://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewTokenMinterClient Uses

func NewTokenMinterClient(cc grpc.ClientConnInterface) TokenMinterClient

type TokenMinterServer Uses

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)
    // contains filtered or unexported methods
}

TokenMinterServer is the server API for TokenMinter service. All implementations must embed UnimplementedTokenMinterServer for forward compatibility

type UnimplementedTokenMinterServer Uses

type UnimplementedTokenMinterServer struct {
}

UnimplementedTokenMinterServer must be embedded to have forward compatible implementations.

func (UnimplementedTokenMinterServer) MintDelegationToken Uses

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

func (UnimplementedTokenMinterServer) MintMachineToken Uses

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

func (UnimplementedTokenMinterServer) MintOAuthTokenGrant Uses

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

func (UnimplementedTokenMinterServer) MintOAuthTokenViaGrant Uses

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

func (UnimplementedTokenMinterServer) MintProjectToken Uses

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

func (UnimplementedTokenMinterServer) MintServiceAccountToken Uses

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

type UnsafeTokenMinterServer Uses

type UnsafeTokenMinterServer interface {
    // contains filtered or unexported methods
}

UnsafeTokenMinterServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TokenMinterServer will result in compilation errors.

Package minter imports 13 packages (graph) and is imported by 23 packages. Updated 2021-01-20. Refresh now. Tools for package owners.