token

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ValidateResponse_Status_name = map[int32]string{
		0: "OK",
		1: "INVALID",
		2: "NOT_FOUND",
		3: "DISABLED",
		4: "EXPIRED",
	}
	ValidateResponse_Status_value = map[string]int32{
		"OK":        0,
		"INVALID":   1,
		"NOT_FOUND": 2,
		"DISABLED":  3,
		"EXPIRED":   4,
	}
)

Enum value maps for ValidateResponse_Status.

View Source
var (
	RefreshResponse_Status_name = map[int32]string{
		0: "OK",
		1: "INVALID",
		2: "NOT_FOUND",
		3: "DISABLED",
		4: "EXPIRED",
		5: "NOT_REFRESH_TOKEN",
	}
	RefreshResponse_Status_value = map[string]int32{
		"OK":                0,
		"INVALID":           1,
		"NOT_FOUND":         2,
		"DISABLED":          3,
		"EXPIRED":           4,
		"NOT_REFRESH_TOKEN": 5,
	}
)

Enum value maps for RefreshResponse_Status.

View Source
var (
	GetTokensForIdentityRequest_ActiveFilter_name = map[int32]string{
		0: "ALL",
		1: "ONLY_ACTIVE",
		2: "ONLY_NOT_ACTIVE",
	}
	GetTokensForIdentityRequest_ActiveFilter_value = map[string]int32{
		"ALL":             0,
		"ONLY_ACTIVE":     1,
		"ONLY_NOT_ACTIVE": 2,
	}
)

Enum value maps for GetTokensForIdentityRequest_ActiveFilter.

View Source
var File_token_proto protoreflect.FileDescriptor
View Source
var IAMTokenService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "native_iam_token.IAMTokenService",
	HandlerType: (*IAMTokenServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Create",
			Handler:    _IAMTokenService_Create_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _IAMTokenService_Get_Handler,
		},
		{
			MethodName: "RawGet",
			Handler:    _IAMTokenService_RawGet_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _IAMTokenService_Delete_Handler,
		},
		{
			MethodName: "Disable",
			Handler:    _IAMTokenService_Disable_Handler,
		},
		{
			MethodName: "Validate",
			Handler:    _IAMTokenService_Validate_Handler,
		},
		{
			MethodName: "Refresh",
			Handler:    _IAMTokenService_Refresh_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GetTokensForIdentity",
			Handler:       _IAMTokenService_GetTokensForIdentity_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "token.proto",
}

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

Functions

func RegisterIAMTokenServiceServer

func RegisterIAMTokenServiceServer(s grpc.ServiceRegistrar, srv IAMTokenServiceServer)

Types

type CreateRequest

type CreateRequest struct {

	// Namespace of the token. Empty for global token.
	Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// Identity UUID of the token
	Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"`
	// Scopes that will be applied to the token
	Scopes []*Scope `protobuf:"bytes,3,rep,name=scopes,proto3" json:"scopes,omitempty"`
	// Arbitrary metadata. For example MAC/IP/information of the actor/application/browser/machine that created this token. The exact format of metadata is not defined, but JSON is suggested.
	Metadata string `protobuf:"bytes,8,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateRequest) Descriptor deprecated

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

Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.

func (*CreateRequest) GetIdentity

func (x *CreateRequest) GetIdentity() string

func (*CreateRequest) GetMetadata

func (x *CreateRequest) GetMetadata() string

func (*CreateRequest) GetNamespace

func (x *CreateRequest) GetNamespace() string

func (*CreateRequest) GetScopes

func (x *CreateRequest) GetScopes() []*Scope

func (*CreateRequest) ProtoMessage

func (*CreateRequest) ProtoMessage()

func (*CreateRequest) ProtoReflect

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

func (*CreateRequest) Reset

func (x *CreateRequest) Reset()

func (*CreateRequest) String

func (x *CreateRequest) String() string

type CreateResponse

type CreateResponse struct {

	// Actual token formated to the string.
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// Refreshtoken is used to update token
	RefreshToken string `protobuf:"bytes,2,opt,name=refreshToken,proto3" json:"refreshToken,omitempty"`
	// Token data
	TokenData *TokenData `protobuf:"bytes,3,opt,name=tokenData,proto3" json:"tokenData,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateResponse) Descriptor deprecated

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

Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead.

func (*CreateResponse) GetRefreshToken

func (x *CreateResponse) GetRefreshToken() string

func (*CreateResponse) GetToken

func (x *CreateResponse) GetToken() string

func (*CreateResponse) GetTokenData

func (x *CreateResponse) GetTokenData() *TokenData

func (*CreateResponse) ProtoMessage

func (*CreateResponse) ProtoMessage()

func (*CreateResponse) ProtoReflect

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

func (*CreateResponse) Reset

func (x *CreateResponse) Reset()

func (*CreateResponse) String

func (x *CreateResponse) String() string

type DeleteRequest

type DeleteRequest struct {

	// Namespace of the token. Empty for global token.
	Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// Unique identifier of the token inside namespace
	Uuid string `protobuf:"bytes,2,opt,name=uuid,proto3" json:"uuid,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteRequest) Descriptor deprecated

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

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetNamespace

func (x *DeleteRequest) GetNamespace() string

func (*DeleteRequest) GetUuid

func (x *DeleteRequest) GetUuid() string

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect

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

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

type DeleteResponse

type DeleteResponse struct {

	// Indicates if token existed before request or it was already deleted.
	Existed bool `protobuf:"varint,1,opt,name=existed,proto3" json:"existed,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteResponse) Descriptor deprecated

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

Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.

func (*DeleteResponse) GetExisted

func (x *DeleteResponse) GetExisted() bool

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) ProtoReflect

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

func (*DeleteResponse) Reset

func (x *DeleteResponse) Reset()

func (*DeleteResponse) String

func (x *DeleteResponse) String() string

type DisableRequest

type DisableRequest struct {

	// Namespace of the token. Empty for global token.
	Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// Unique identifier of the token inside namespace
	Uuid string `protobuf:"bytes,2,opt,name=uuid,proto3" json:"uuid,omitempty"`
	// contains filtered or unexported fields
}

func (*DisableRequest) Descriptor deprecated

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

Deprecated: Use DisableRequest.ProtoReflect.Descriptor instead.

func (*DisableRequest) GetNamespace

func (x *DisableRequest) GetNamespace() string

func (*DisableRequest) GetUuid

func (x *DisableRequest) GetUuid() string

func (*DisableRequest) ProtoMessage

func (*DisableRequest) ProtoMessage()

func (*DisableRequest) ProtoReflect

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

func (*DisableRequest) Reset

func (x *DisableRequest) Reset()

func (*DisableRequest) String

func (x *DisableRequest) String() string

type DisableResponse

type DisableResponse struct {
	// contains filtered or unexported fields
}

func (*DisableResponse) Descriptor deprecated

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

Deprecated: Use DisableResponse.ProtoReflect.Descriptor instead.

func (*DisableResponse) ProtoMessage

func (*DisableResponse) ProtoMessage()

func (*DisableResponse) ProtoReflect

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

func (*DisableResponse) Reset

func (x *DisableResponse) Reset()

func (*DisableResponse) String

func (x *DisableResponse) String() string

type GetRequest

type GetRequest struct {

	// Namespace of the token. Empty for global token.
	Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// Unique identifier of the token inside namespace
	Uuid string `protobuf:"bytes,2,opt,name=uuid,proto3" json:"uuid,omitempty"`
	// Use cache for faster authorization. Cache has a very low chance to not be valid. If cache is not valid it will be deleted after short period of time (30 seconds by default)
	UseCache bool `protobuf:"varint,3,opt,name=useCache,proto3" json:"useCache,omitempty"`
	// contains filtered or unexported fields
}

func (*GetRequest) Descriptor deprecated

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

Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.

func (*GetRequest) GetNamespace

func (x *GetRequest) GetNamespace() string

func (*GetRequest) GetUseCache

func (x *GetRequest) GetUseCache() bool

func (*GetRequest) GetUuid

func (x *GetRequest) GetUuid() string

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) ProtoReflect

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

func (*GetRequest) Reset

func (x *GetRequest) Reset()

func (*GetRequest) String

func (x *GetRequest) String() string

type GetResponse

type GetResponse struct {

	// Actual token data
	TokenData *TokenData `protobuf:"bytes,1,opt,name=tokenData,proto3" json:"tokenData,omitempty"`
	// contains filtered or unexported fields
}

func (*GetResponse) Descriptor deprecated

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

Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.

func (*GetResponse) GetTokenData

func (x *GetResponse) GetTokenData() *TokenData

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) ProtoReflect

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

func (*GetResponse) Reset

func (x *GetResponse) Reset()

func (*GetResponse) String

func (x *GetResponse) String() string

type GetTokensForIdentityRequest

type GetTokensForIdentityRequest struct {

	// Namespace where token is located. Empty for global token
	Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// Identity unique identifier inside namespace
	Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"`
	// Perform results filtering on "active" property of the token
	ActiveFilter GetTokensForIdentityRequest_ActiveFilter `` /* 141-byte string literal not displayed */
	// Skip number of results before returning actual tokens. Set to 0 in order not to skip
	Skip uint32 `protobuf:"varint,4,opt,name=skip,proto3" json:"skip,omitempty"`
	// Limit number of returned results. Set to 0 in order to remove limit and return all possible results up to the end.
	Limit uint32 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTokensForIdentityRequest) Descriptor deprecated

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

Deprecated: Use GetTokensForIdentityRequest.ProtoReflect.Descriptor instead.

func (*GetTokensForIdentityRequest) GetActiveFilter

func (*GetTokensForIdentityRequest) GetIdentity

func (x *GetTokensForIdentityRequest) GetIdentity() string

func (*GetTokensForIdentityRequest) GetLimit

func (x *GetTokensForIdentityRequest) GetLimit() uint32

func (*GetTokensForIdentityRequest) GetNamespace

func (x *GetTokensForIdentityRequest) GetNamespace() string

func (*GetTokensForIdentityRequest) GetSkip

func (x *GetTokensForIdentityRequest) GetSkip() uint32

func (*GetTokensForIdentityRequest) ProtoMessage

func (*GetTokensForIdentityRequest) ProtoMessage()

func (*GetTokensForIdentityRequest) ProtoReflect

func (*GetTokensForIdentityRequest) Reset

func (x *GetTokensForIdentityRequest) Reset()

func (*GetTokensForIdentityRequest) String

func (x *GetTokensForIdentityRequest) String() string

type GetTokensForIdentityRequest_ActiveFilter

type GetTokensForIdentityRequest_ActiveFilter int32
const (
	// Get all token
	GetTokensForIdentityRequest_ALL GetTokensForIdentityRequest_ActiveFilter = 0
	// Only get tokens that wasnt disabled and not expired
	GetTokensForIdentityRequest_ONLY_ACTIVE GetTokensForIdentityRequest_ActiveFilter = 1
	// Only get tokens that are disabled or expired
	GetTokensForIdentityRequest_ONLY_NOT_ACTIVE GetTokensForIdentityRequest_ActiveFilter = 2
)

func (GetTokensForIdentityRequest_ActiveFilter) Descriptor

func (GetTokensForIdentityRequest_ActiveFilter) Enum

func (GetTokensForIdentityRequest_ActiveFilter) EnumDescriptor deprecated

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

Deprecated: Use GetTokensForIdentityRequest_ActiveFilter.Descriptor instead.

func (GetTokensForIdentityRequest_ActiveFilter) Number

func (GetTokensForIdentityRequest_ActiveFilter) String

func (GetTokensForIdentityRequest_ActiveFilter) Type

type GetTokensForIdentityResponse

type GetTokensForIdentityResponse struct {

	// Actual token data
	TokenData *TokenData `protobuf:"bytes,1,opt,name=tokenData,proto3" json:"tokenData,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTokensForIdentityResponse) Descriptor deprecated

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

Deprecated: Use GetTokensForIdentityResponse.ProtoReflect.Descriptor instead.

func (*GetTokensForIdentityResponse) GetTokenData

func (x *GetTokensForIdentityResponse) GetTokenData() *TokenData

func (*GetTokensForIdentityResponse) ProtoMessage

func (*GetTokensForIdentityResponse) ProtoMessage()

func (*GetTokensForIdentityResponse) ProtoReflect

func (*GetTokensForIdentityResponse) Reset

func (x *GetTokensForIdentityResponse) Reset()

func (*GetTokensForIdentityResponse) String

type IAMTokenServiceClient

type IAMTokenServiceClient interface {
	// Create new token
	Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error)
	// Get token data using token UUID (unique identifier)
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
	// Get token data using raw access/refresh token. Validates if token still exists in the system.
	RawGet(ctx context.Context, in *RawGetRequest, opts ...grpc.CallOption) (*RawGetResponse, error)
	// Delete token using token UUID (unique identifier)
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
	// Disable token using its unique identifier
	Disable(ctx context.Context, in *DisableRequest, opts ...grpc.CallOption) (*DisableResponse, error)
	// Validates token and gets its data
	Validate(ctx context.Context, in *ValidateRequest, opts ...grpc.CallOption) (*ValidateResponse, error)
	// Validates refresh token and create new token based on it. New token will have same scopes
	Refresh(ctx context.Context, in *RefreshRequest, opts ...grpc.CallOption) (*RefreshResponse, error)
	// Returns list of tokens for specified identity
	GetTokensForIdentity(ctx context.Context, in *GetTokensForIdentityRequest, opts ...grpc.CallOption) (IAMTokenService_GetTokensForIdentityClient, error)
}

IAMTokenServiceClient is the client API for IAMTokenService 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.

type IAMTokenServiceServer

type IAMTokenServiceServer interface {
	// Create new token
	Create(context.Context, *CreateRequest) (*CreateResponse, error)
	// Get token data using token UUID (unique identifier)
	Get(context.Context, *GetRequest) (*GetResponse, error)
	// Get token data using raw access/refresh token. Validates if token still exists in the system.
	RawGet(context.Context, *RawGetRequest) (*RawGetResponse, error)
	// Delete token using token UUID (unique identifier)
	Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
	// Disable token using its unique identifier
	Disable(context.Context, *DisableRequest) (*DisableResponse, error)
	// Validates token and gets its data
	Validate(context.Context, *ValidateRequest) (*ValidateResponse, error)
	// Validates refresh token and create new token based on it. New token will have same scopes
	Refresh(context.Context, *RefreshRequest) (*RefreshResponse, error)
	// Returns list of tokens for specified identity
	GetTokensForIdentity(*GetTokensForIdentityRequest, IAMTokenService_GetTokensForIdentityServer) error
	// contains filtered or unexported methods
}

IAMTokenServiceServer is the server API for IAMTokenService service. All implementations must embed UnimplementedIAMTokenServiceServer for forward compatibility

type IAMTokenService_GetTokensForIdentityClient

type IAMTokenService_GetTokensForIdentityClient interface {
	Recv() (*GetTokensForIdentityResponse, error)
	grpc.ClientStream
}

type IAMTokenService_GetTokensForIdentityServer

type IAMTokenService_GetTokensForIdentityServer interface {
	Send(*GetTokensForIdentityResponse) error
	grpc.ServerStream
}

type RawGetRequest

type RawGetRequest struct {

	// Refresh or access token
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// Use cache for faster authorization. Cache has a very low chance to not be valid. If cache is not valid it will be deleted after short period of time (30 seconds by default)
	UseCache bool `protobuf:"varint,2,opt,name=useCache,proto3" json:"useCache,omitempty"`
	// contains filtered or unexported fields
}

func (*RawGetRequest) Descriptor deprecated

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

Deprecated: Use RawGetRequest.ProtoReflect.Descriptor instead.

func (*RawGetRequest) GetToken

func (x *RawGetRequest) GetToken() string

func (*RawGetRequest) GetUseCache

func (x *RawGetRequest) GetUseCache() bool

func (*RawGetRequest) ProtoMessage

func (*RawGetRequest) ProtoMessage()

func (*RawGetRequest) ProtoReflect

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

func (*RawGetRequest) Reset

func (x *RawGetRequest) Reset()

func (*RawGetRequest) String

func (x *RawGetRequest) String() string

type RawGetResponse

type RawGetResponse struct {

	// Actual token data
	TokenData *TokenData `protobuf:"bytes,1,opt,name=tokenData,proto3" json:"tokenData,omitempty"`
	// contains filtered or unexported fields
}

func (*RawGetResponse) Descriptor deprecated

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

Deprecated: Use RawGetResponse.ProtoReflect.Descriptor instead.

func (*RawGetResponse) GetTokenData

func (x *RawGetResponse) GetTokenData() *TokenData

func (*RawGetResponse) ProtoMessage

func (*RawGetResponse) ProtoMessage()

func (*RawGetResponse) ProtoReflect

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

func (*RawGetResponse) Reset

func (x *RawGetResponse) Reset()

func (*RawGetResponse) String

func (x *RawGetResponse) String() string

type RefreshRequest

type RefreshRequest struct {

	// Refresh token, based on which, new token will be returned
	RefreshToken string `protobuf:"bytes,1,opt,name=refreshToken,proto3" json:"refreshToken,omitempty"`
	// contains filtered or unexported fields
}

func (*RefreshRequest) Descriptor deprecated

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

Deprecated: Use RefreshRequest.ProtoReflect.Descriptor instead.

func (*RefreshRequest) GetRefreshToken

func (x *RefreshRequest) GetRefreshToken() string

func (*RefreshRequest) ProtoMessage

func (*RefreshRequest) ProtoMessage()

func (*RefreshRequest) ProtoReflect

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

func (*RefreshRequest) Reset

func (x *RefreshRequest) Reset()

func (*RefreshRequest) String

func (x *RefreshRequest) String() string

type RefreshResponse

type RefreshResponse struct {
	Status RefreshResponse_Status `protobuf:"varint,1,opt,name=status,proto3,enum=native_iam_token.RefreshResponse_Status" json:"status,omitempty"`
	// New token if status is OK. Null otherwise
	Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
	// New token data if status is OK. Null otherwise
	TokenData *TokenData `protobuf:"bytes,3,opt,name=tokenData,proto3" json:"tokenData,omitempty"`
	// contains filtered or unexported fields
}

func (*RefreshResponse) Descriptor deprecated

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

Deprecated: Use RefreshResponse.ProtoReflect.Descriptor instead.

func (*RefreshResponse) GetStatus

func (x *RefreshResponse) GetStatus() RefreshResponse_Status

func (*RefreshResponse) GetToken

func (x *RefreshResponse) GetToken() string

func (*RefreshResponse) GetTokenData

func (x *RefreshResponse) GetTokenData() *TokenData

func (*RefreshResponse) ProtoMessage

func (*RefreshResponse) ProtoMessage()

func (*RefreshResponse) ProtoReflect

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

func (*RefreshResponse) Reset

func (x *RefreshResponse) Reset()

func (*RefreshResponse) String

func (x *RefreshResponse) String() string

type RefreshResponse_Status

type RefreshResponse_Status int32
const (
	// Token is valid
	RefreshResponse_OK RefreshResponse_Status = 0
	// Token has bad format or invalid signature
	RefreshResponse_INVALID RefreshResponse_Status = 1
	// Token not found
	RefreshResponse_NOT_FOUND RefreshResponse_Status = 2
	// Token was manually disabled
	RefreshResponse_DISABLED RefreshResponse_Status = 3
	// Token expired and is not valid
	RefreshResponse_EXPIRED RefreshResponse_Status = 4
	// This token is valid but this is not refresh token
	RefreshResponse_NOT_REFRESH_TOKEN RefreshResponse_Status = 5
)

func (RefreshResponse_Status) Descriptor

func (RefreshResponse_Status) Enum

func (RefreshResponse_Status) EnumDescriptor deprecated

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

Deprecated: Use RefreshResponse_Status.Descriptor instead.

func (RefreshResponse_Status) Number

func (RefreshResponse_Status) String

func (x RefreshResponse_Status) String() string

func (RefreshResponse_Status) Type

type Scope

type Scope struct {

	// Namespace to which scope is bounded. Empty string if scope is not bounded to any namespace (is global)
	Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// Resources that can be accessed using this token
	Resources []string `protobuf:"bytes,2,rep,name=resources,proto3" json:"resources,omitempty"`
	// Actions that can be performed on accessible resources
	Actions []string `protobuf:"bytes,3,rep,name=actions,proto3" json:"actions,omitempty"`
	// Should scope work in all namespaces
	NamespaceIndependent bool `protobuf:"varint,4,opt,name=namespaceIndependent,proto3" json:"namespaceIndependent,omitempty"`
	// contains filtered or unexported fields
}

Scope defines what can be accessed by token and what actions can be performed on accessible resources. Scope is bounded the namespace where resources are located.

func (*Scope) Descriptor deprecated

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

Deprecated: Use Scope.ProtoReflect.Descriptor instead.

func (*Scope) GetActions

func (x *Scope) GetActions() []string

func (*Scope) GetNamespace

func (x *Scope) GetNamespace() string

func (*Scope) GetNamespaceIndependent added in v0.0.3

func (x *Scope) GetNamespaceIndependent() bool

func (*Scope) GetResources

func (x *Scope) GetResources() []string

func (*Scope) ProtoMessage

func (*Scope) ProtoMessage()

func (*Scope) ProtoReflect

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

func (*Scope) Reset

func (x *Scope) Reset()

func (*Scope) String

func (x *Scope) String() string

type TokenData

type TokenData struct {

	// Namespace where token and identity are located. Epmty for global token (without namespace)
	Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// Unique identifier of the token inside namespace
	Uuid string `protobuf:"bytes,2,opt,name=uuid,proto3" json:"uuid,omitempty"`
	// Token identity unique identifier inside namespace
	Identity string `protobuf:"bytes,3,opt,name=identity,proto3" json:"identity,omitempty"`
	// Identifies if token was manually disabled. Disabled token always fails on authorization and can not be reenabled
	Disabled bool `protobuf:"varint,4,opt,name=disabled,proto3" json:"disabled,omitempty"`
	// Datetime after with token will not be valid and will fail on Refresh and Authorize attempts
	ExpiresAt *timestamp.Timestamp `protobuf:"bytes,5,opt,name=expiresAt,proto3" json:"expiresAt,omitempty"`
	// List of token scopes. Describes what actions can token perform on what resources
	Scopes []*Scope `protobuf:"bytes,6,rep,name=scopes,proto3" json:"scopes,omitempty"`
	// Datetime when token was created
	CreatedAt *timestamp.Timestamp `protobuf:"bytes,7,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
	// Arbitrary metadata added on token creation. For example MAC/IP/information of the actor/application/browser/machine that created this token. The exact format of metadata is not defined, but JSON is suggested.
	CreationMetadata string `protobuf:"bytes,8,opt,name=creationMetadata,proto3" json:"creationMetadata,omitempty"`
	// contains filtered or unexported fields
}

func (*TokenData) Descriptor deprecated

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

Deprecated: Use TokenData.ProtoReflect.Descriptor instead.

func (*TokenData) GetCreatedAt

func (x *TokenData) GetCreatedAt() *timestamp.Timestamp

func (*TokenData) GetCreationMetadata

func (x *TokenData) GetCreationMetadata() string

func (*TokenData) GetDisabled

func (x *TokenData) GetDisabled() bool

func (*TokenData) GetExpiresAt

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

func (*TokenData) GetIdentity

func (x *TokenData) GetIdentity() string

func (*TokenData) GetNamespace

func (x *TokenData) GetNamespace() string

func (*TokenData) GetScopes

func (x *TokenData) GetScopes() []*Scope

func (*TokenData) GetUuid

func (x *TokenData) GetUuid() string

func (*TokenData) ProtoMessage

func (*TokenData) ProtoMessage()

func (*TokenData) ProtoReflect

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

func (*TokenData) Reset

func (x *TokenData) Reset()

func (*TokenData) String

func (x *TokenData) String() string

type UnimplementedIAMTokenServiceServer

type UnimplementedIAMTokenServiceServer struct {
}

UnimplementedIAMTokenServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedIAMTokenServiceServer) Create

func (UnimplementedIAMTokenServiceServer) Delete

func (UnimplementedIAMTokenServiceServer) Disable

func (UnimplementedIAMTokenServiceServer) Get

func (UnimplementedIAMTokenServiceServer) RawGet

func (UnimplementedIAMTokenServiceServer) Refresh

func (UnimplementedIAMTokenServiceServer) Validate

type UnsafeIAMTokenServiceServer

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

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

type ValidateRequest

type ValidateRequest struct {

	// Token to validate
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// Use cache for faster validation. Cache has a very low chance to not be valid. If cache is not valid it will be deleted after short period of time (30 seconds by default)
	UseCache bool `protobuf:"varint,2,opt,name=useCache,proto3" json:"useCache,omitempty"`
	// contains filtered or unexported fields
}

func (*ValidateRequest) Descriptor deprecated

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

Deprecated: Use ValidateRequest.ProtoReflect.Descriptor instead.

func (*ValidateRequest) GetToken

func (x *ValidateRequest) GetToken() string

func (*ValidateRequest) GetUseCache

func (x *ValidateRequest) GetUseCache() bool

func (*ValidateRequest) ProtoMessage

func (*ValidateRequest) ProtoMessage()

func (*ValidateRequest) ProtoReflect

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

func (*ValidateRequest) Reset

func (x *ValidateRequest) Reset()

func (*ValidateRequest) String

func (x *ValidateRequest) String() string

type ValidateResponse

type ValidateResponse struct {
	Status ValidateResponse_Status `protobuf:"varint,1,opt,name=status,proto3,enum=native_iam_token.ValidateResponse_Status" json:"status,omitempty"`
	// Token data. Null if status is not OK
	TokenData *TokenData `protobuf:"bytes,2,opt,name=tokenData,proto3" json:"tokenData,omitempty"`
	// contains filtered or unexported fields
}

func (*ValidateResponse) Descriptor deprecated

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

Deprecated: Use ValidateResponse.ProtoReflect.Descriptor instead.

func (*ValidateResponse) GetStatus

func (*ValidateResponse) GetTokenData

func (x *ValidateResponse) GetTokenData() *TokenData

func (*ValidateResponse) ProtoMessage

func (*ValidateResponse) ProtoMessage()

func (*ValidateResponse) ProtoReflect

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

func (*ValidateResponse) Reset

func (x *ValidateResponse) Reset()

func (*ValidateResponse) String

func (x *ValidateResponse) String() string

type ValidateResponse_Status

type ValidateResponse_Status int32
const (
	// Token is valid
	ValidateResponse_OK ValidateResponse_Status = 0
	// Token has bad format or invalid signature
	ValidateResponse_INVALID ValidateResponse_Status = 1
	// Token not found
	ValidateResponse_NOT_FOUND ValidateResponse_Status = 2
	// Token was manually disabled
	ValidateResponse_DISABLED ValidateResponse_Status = 3
	// Token expired and is not valid
	ValidateResponse_EXPIRED ValidateResponse_Status = 4
)

func (ValidateResponse_Status) Descriptor

func (ValidateResponse_Status) Enum

func (ValidateResponse_Status) EnumDescriptor deprecated

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

Deprecated: Use ValidateResponse_Status.Descriptor instead.

func (ValidateResponse_Status) Number

func (ValidateResponse_Status) String

func (x ValidateResponse_Status) String() string

func (ValidateResponse_Status) Type

Jump to

Keyboard shortcuts

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