token

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2025 License: GPL-3.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_token_introspect_proto protoreflect.FileDescriptor
View Source
var File_proto_token_response_proto protoreflect.FileDescriptor
View Source
var File_proto_token_ticket_proto protoreflect.FileDescriptor
View Source
var File_proto_token_token_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type AuthenticationTicket added in v1.3.4

type AuthenticationTicket struct {

	// application - The application that user is attempting to issue a token from
	Application *application.Application `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty" bson:"application"` // @gotags: bson:"application"
	// api - The API that the represents the audience the user wants a token from
	Api *api.API `protobuf:"bytes,2,opt,name=api,proto3" json:"api,omitempty" bson:"api"` // @gotags: bson:"api"
	// token_request - The token request that the user has made
	TokenRequest *request.TokenRequest `protobuf:"bytes,3,opt,name=token_request,json=tokenRequest,proto3" json:"token_request,omitempty" bson:"token_request"` // @gotags: bson:"token_request"
	// contains filtered or unexported fields
}

AuthenticationTicket - An authentication ticket is an internal structure used by CredStack to issue tokens. This is not defined within the OAuth/OIDC spec, however its existence keeps functions clean and prevents having 4-5 parameters in a single function

TODO: Ideally, this would include claims as well however creating a claims structure would mean we would have to write functions for marshaling this

func (*AuthenticationTicket) Descriptor deprecated added in v1.3.4

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

Deprecated: Use AuthenticationTicket.ProtoReflect.Descriptor instead.

func (*AuthenticationTicket) GetApi added in v1.3.4

func (x *AuthenticationTicket) GetApi() *api.API

func (*AuthenticationTicket) GetApplication added in v1.3.4

func (x *AuthenticationTicket) GetApplication() *application.Application

func (*AuthenticationTicket) GetTokenRequest added in v1.3.4

func (x *AuthenticationTicket) GetTokenRequest() *request.TokenRequest

func (*AuthenticationTicket) ProtoMessage added in v1.3.4

func (*AuthenticationTicket) ProtoMessage()

func (*AuthenticationTicket) ProtoReflect added in v1.3.4

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

func (*AuthenticationTicket) Reset added in v1.3.4

func (x *AuthenticationTicket) Reset()

func (*AuthenticationTicket) String added in v1.3.4

func (x *AuthenticationTicket) String() string

type Token

type Token struct {

	// sub - The subject the token was issued for. Can be a user id or a client ID
	Sub string `protobuf:"bytes,1,opt,name=sub,proto3" json:"sub,omitempty" bson:"sub"` // @gotags: bson:"sub"
	// client_id - The client ID of the application that issued the token
	ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" bson:"client_id"` // @gotags: bson:"client_id"
	// access_token - The access token that was issued
	AccessToken string `protobuf:"bytes,3,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty" bson:"access_token"` // @gotags: bson:"access_token"
	// refresh_token - The refresh token that was issued
	RefreshToken string `protobuf:"bytes,4,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty" bson:"refresh_token"` // @gotags: bson:"refresh_token"
	// id_token - The ID token that was issued
	IdToken string `protobuf:"bytes,5,opt,name=id_token,json=idToken,proto3" json:"id_token,omitempty" bson:"id_token"` // @gotags: bson:"id_token"
	// expires_in - The time in seconds that the token expires in
	ExpiresIn uint32 `protobuf:"varint,6,opt,name=expires_in,json=expiresIn,proto3" json:"expires_in,omitempty" bson:"expires_in"` // @gotags: bson:"expires_in"
	// expires_at - A timestamp that represents the datetime in which the access token expires
	ExpiresAt *timestamp.Timestamp `protobuf:"bytes,7,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty" bson:"expires_at"` // @gotags: bson:"expires_at"
	// refresh_expires_at - A timestamp that represents the datetime in which the refresh token expires
	RefreshExpiresAt *timestamp.Timestamp `` // @gotags: bson:"refresh_expires_at"
	/* 137-byte string literal not displayed */
	// scope - Any permission scopes that were issued with the token
	Scope string `protobuf:"bytes,9,opt,name=scope,proto3" json:"scope,omitempty" bson:"scope"` // @gotags: bson:"scope"
	// contains filtered or unexported fields
}

Token - An internal representation of an issued token. This is generally not displayed to the user, but is instead used for tracking tokens internally in the database

func (*Token) Descriptor deprecated

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

Deprecated: Use Token.ProtoReflect.Descriptor instead.

func (*Token) GetAccessToken

func (x *Token) GetAccessToken() string

func (*Token) GetClientId

func (x *Token) GetClientId() string

func (*Token) GetExpiresAt

func (x *Token) GetExpiresAt() *timestamp.Timestamp

func (*Token) GetExpiresIn

func (x *Token) GetExpiresIn() uint32

func (*Token) GetIdToken

func (x *Token) GetIdToken() string

func (*Token) GetRefreshExpiresAt

func (x *Token) GetRefreshExpiresAt() *timestamp.Timestamp

func (*Token) GetRefreshToken

func (x *Token) GetRefreshToken() string

func (*Token) GetScope

func (x *Token) GetScope() string

func (*Token) GetSub

func (x *Token) GetSub() string

func (*Token) ProtoMessage

func (*Token) ProtoMessage()

func (*Token) ProtoReflect

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

func (*Token) Reset

func (x *Token) Reset()

func (*Token) String

func (x *Token) String() string

type TokenIntrospectResponse added in v1.3.3

type TokenIntrospectResponse struct {

	// active - A boolean value that determines if the token is active or not
	Active bool `protobuf:"varint,1,opt,name=active,proto3" json:"active,omitempty" bson:"active"` // @gotags: bson:"active"
	// client_id - The client identifier for the application that issued the token
	ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty" bson:"client_id"` // @gotags: bson:"client_id"
	// sub - The subject of who the token was issued for. Can be a username or client id if client credentials flow was used
	Sub string `protobuf:"bytes,3,opt,name=sub,proto3" json:"sub,omitempty" bson:"sub"` // @gotags: bson:"sub"
	// scope - Any scopes that were issued with the token
	Scope string `protobuf:"bytes,4,opt,name=scope,proto3" json:"scope,omitempty" bson:"scope"` // @gotags: bson:"scope"
	// exp - A unix timestamp representing the tokens expiration date
	Exp int64 `protobuf:"varint,5,opt,name=exp,proto3" json:"exp,omitempty" bson:"exp"` // @gotags: bson:"exp"
	// contains filtered or unexported fields
}

TokenIntrospectResponse - Represents a response from the endpoint /oauth/introspect

func (*TokenIntrospectResponse) Descriptor deprecated added in v1.3.3

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

Deprecated: Use TokenIntrospectResponse.ProtoReflect.Descriptor instead.

func (*TokenIntrospectResponse) GetActive added in v1.3.3

func (x *TokenIntrospectResponse) GetActive() bool

func (*TokenIntrospectResponse) GetClientId added in v1.3.3

func (x *TokenIntrospectResponse) GetClientId() string

func (*TokenIntrospectResponse) GetExp added in v1.3.3

func (x *TokenIntrospectResponse) GetExp() int64

func (*TokenIntrospectResponse) GetScope added in v1.3.3

func (x *TokenIntrospectResponse) GetScope() string

func (*TokenIntrospectResponse) GetSub added in v1.3.3

func (x *TokenIntrospectResponse) GetSub() string

func (*TokenIntrospectResponse) ProtoMessage added in v1.3.3

func (*TokenIntrospectResponse) ProtoMessage()

func (*TokenIntrospectResponse) ProtoReflect added in v1.3.3

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

func (*TokenIntrospectResponse) Reset added in v1.3.3

func (x *TokenIntrospectResponse) Reset()

func (*TokenIntrospectResponse) String added in v1.3.3

func (x *TokenIntrospectResponse) String() string

type TokenResponse

type TokenResponse struct {

	// access_token - The JWT token as returned by the application
	AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty" bson:"access_token"` // @gotags: bson:"access_token"
	// id_token - The JWT token as returned by the application
	IdToken string `protobuf:"bytes,2,opt,name=id_token,json=idToken,proto3" json:"id_token,omitempty" bson:"id_token"` // @gotags: bson:"id_token"
	// token_type - The type of token this response represents. Usually bearer
	TokenType string `protobuf:"bytes,3,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty" bson:"token_type"` // @gotags: bson:"token_type"
	// expires_in - The time in seconds that the token expires in
	ExpiresIn uint32 `protobuf:"varint,4,opt,name=expires_in,json=expiresIn,proto3" json:"expires_in,omitempty" bson:"expires_in"` // @gotags: bson:"expires_in"
	// refresh_token - The refresh token that the application has issued
	RefreshToken string `protobuf:"bytes,5,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty" bson:"refresh_token"` // @gotags: bson:"refresh_token"
	// scope - A string of space seperated scopes that the user has been issued
	Scope string `protobuf:"bytes,6,opt,name=scope,proto3" json:"scope,omitempty" bson:"scope"` // @gotags: bson:"scope"
	// contains filtered or unexported fields
}

TokenResponse - Represents an HTTP response containing the credentials requested by the end user

func (*TokenResponse) Descriptor deprecated

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

Deprecated: Use TokenResponse.ProtoReflect.Descriptor instead.

func (*TokenResponse) GetAccessToken

func (x *TokenResponse) GetAccessToken() string

func (*TokenResponse) GetExpiresIn

func (x *TokenResponse) GetExpiresIn() uint32

func (*TokenResponse) GetIdToken

func (x *TokenResponse) GetIdToken() string

func (*TokenResponse) GetRefreshToken

func (x *TokenResponse) GetRefreshToken() string

func (*TokenResponse) GetScope

func (x *TokenResponse) GetScope() string

func (*TokenResponse) GetTokenType

func (x *TokenResponse) GetTokenType() string

func (*TokenResponse) ProtoMessage

func (*TokenResponse) ProtoMessage()

func (*TokenResponse) ProtoReflect

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

func (*TokenResponse) Reset

func (x *TokenResponse) Reset()

func (*TokenResponse) String

func (x *TokenResponse) String() string

Jump to

Keyboard shortcuts

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