principal

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TokenStatus_name = map[int32]string{
		0: "UNKNOWN",
		1: "VALID",
		2: "REFRESHING",
		3: "PERMANENT_FAILURE",
	}
	TokenStatus_value = map[string]int32{
		"UNKNOWN":           0,
		"VALID":             1,
		"REFRESHING":        2,
		"PERMANENT_FAILURE": 3,
	}
)

Enum value maps for TokenStatus.

View Source
var File_principal_proto protoreflect.FileDescriptor
View Source
var Unauthenticated = &ID{Data: []byte{
	0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF}}

Unauthenticated is a well-known ID that represents an unauthenticated user.

Functions

func RegisterPrincipalsServer

func RegisterPrincipalsServer(s grpc.ServiceRegistrar, srv PrincipalsServer)

Types

type EnsureRequest

type EnsureRequest struct {
	Principal *Principal `protobuf:"bytes,1,opt,name=principal,proto3" json:"principal,omitempty"`
	Delete    bool       `protobuf:"varint,2,opt,name=delete,proto3" json:"delete,omitempty"`
	// contains filtered or unexported fields
}

func (*EnsureRequest) Descriptor deprecated

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

Deprecated: Use EnsureRequest.ProtoReflect.Descriptor instead.

func (*EnsureRequest) GetDelete

func (x *EnsureRequest) GetDelete() bool

func (*EnsureRequest) GetPrincipal

func (x *EnsureRequest) GetPrincipal() *Principal

func (*EnsureRequest) ProtoMessage

func (*EnsureRequest) ProtoMessage()

func (*EnsureRequest) ProtoReflect

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

func (*EnsureRequest) Reset

func (x *EnsureRequest) Reset()

func (*EnsureRequest) String

func (x *EnsureRequest) String() string

type EnsureResponse

type EnsureResponse struct {
	Principal *Principal `protobuf:"bytes,1,opt,name=principal,proto3" json:"principal,omitempty"`
	// contains filtered or unexported fields
}

func (*EnsureResponse) Descriptor deprecated

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

Deprecated: Use EnsureResponse.ProtoReflect.Descriptor instead.

func (*EnsureResponse) GetPrincipal

func (x *EnsureResponse) GetPrincipal() *Principal

func (*EnsureResponse) ProtoMessage

func (*EnsureResponse) ProtoMessage()

func (*EnsureResponse) ProtoReflect

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

func (*EnsureResponse) Reset

func (x *EnsureResponse) Reset()

func (*EnsureResponse) String

func (x *EnsureResponse) String() string

type ID

type ID struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func NewID

func NewID() *ID

NewID constructs a new ID.

func ParseID

func ParseID(x string) (*ID, error)

ParseID will parse the input as either a canonically-formatted UUID or as a base64-encoded collection of bytes.

func (*ID) AsUUID

func (x *ID) AsUUID() uuid.UUID

AsUUID converts the message to a validated UUID or returns the zero value.

func (*ID) Descriptor deprecated

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

Deprecated: Use ID.ProtoReflect.Descriptor instead.

func (*ID) GetData

func (x *ID) GetData() []byte

func (*ID) ProtoMessage

func (*ID) ProtoMessage()

func (*ID) ProtoReflect

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

func (*ID) Reset

func (x *ID) Reset()

func (*ID) Scan

func (x *ID) Scan(v interface{}) error

Scan implements sql.Scanner.

func (*ID) String

func (x *ID) String() string

func (*ID) Value

func (x *ID) Value() (driver.Value, error)

Value implements driver.Valuer.

func (*ID) Zero

func (x *ID) Zero() bool

Zero returns true if the ID is the zero value.

type LoadRequest

type LoadRequest struct {

	// Types that are assignable to Kind:
	//	*LoadRequest_ID
	//	*LoadRequest_Email
	//	*LoadRequest_EmailDomain
	Kind isLoadRequest_Kind `protobuf_oneof:"Kind"`
	// contains filtered or unexported fields
}

func (*LoadRequest) Descriptor deprecated

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

Deprecated: Use LoadRequest.ProtoReflect.Descriptor instead.

func (*LoadRequest) GetEmail

func (x *LoadRequest) GetEmail() string

func (*LoadRequest) GetEmailDomain

func (x *LoadRequest) GetEmailDomain() string

func (*LoadRequest) GetID

func (x *LoadRequest) GetID() *ID

func (*LoadRequest) GetKind

func (m *LoadRequest) GetKind() isLoadRequest_Kind

func (*LoadRequest) ProtoMessage

func (*LoadRequest) ProtoMessage()

func (*LoadRequest) ProtoReflect

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

func (*LoadRequest) Reset

func (x *LoadRequest) Reset()

func (*LoadRequest) String

func (x *LoadRequest) String() string

type LoadRequest_Email

type LoadRequest_Email struct {
	// Load a Principal by email address.
	Email string `protobuf:"bytes,2,opt,name=email,proto3,oneof"`
}

type LoadRequest_EmailDomain

type LoadRequest_EmailDomain struct {
	// Load a domain-level Principal.
	EmailDomain string `protobuf:"bytes,3,opt,name=email_domain,json=emailDomain,proto3,oneof"`
}

type LoadRequest_ID

type LoadRequest_ID struct {
	// Load a Principal based on ID.
	ID *ID `protobuf:"bytes,1,opt,name=ID,proto3,oneof"`
}

type Principal

type Principal struct {
	ID      *ID    `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	Label   string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"`
	Version int64  `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"`
	// OIDC claims as provided by an authentication server.
	Claims []byte `protobuf:"bytes,4,opt,name=claims,proto3" json:"claims,omitempty"`
	// If present, indicates that the principal represents all users whose
	// email address are in the given domain.
	EmailDomain   string                 `protobuf:"bytes,5,opt,name=email_domain,json=emailDomain,proto3" json:"email_domain,omitempty"`
	RefreshToken  string                 `protobuf:"bytes,66,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
	RefreshAfter  *timestamppb.Timestamp `protobuf:"bytes,67,opt,name=refresh_after,json=refreshAfter,proto3" json:"refresh_after,omitempty"`
	RefreshStatus TokenStatus            `` /* 140-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Principal) Descriptor deprecated

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

Deprecated: Use Principal.ProtoReflect.Descriptor instead.

func (*Principal) GetClaims

func (x *Principal) GetClaims() []byte

func (*Principal) GetEmailDomain

func (x *Principal) GetEmailDomain() string

func (*Principal) GetID

func (x *Principal) GetID() *ID

func (*Principal) GetLabel

func (x *Principal) GetLabel() string

func (*Principal) GetRefreshAfter

func (x *Principal) GetRefreshAfter() *timestamppb.Timestamp

func (*Principal) GetRefreshStatus

func (x *Principal) GetRefreshStatus() TokenStatus

func (*Principal) GetRefreshToken

func (x *Principal) GetRefreshToken() string

func (*Principal) GetVersion

func (x *Principal) GetVersion() int64

func (*Principal) ProtoMessage

func (*Principal) ProtoMessage()

func (*Principal) ProtoReflect

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

func (*Principal) Reset

func (x *Principal) Reset()

func (*Principal) String

func (x *Principal) String() string

type PrincipalsClient

type PrincipalsClient interface {
	Ensure(ctx context.Context, in *EnsureRequest, opts ...grpc.CallOption) (*EnsureResponse, error)
	List(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (Principals_ListClient, error)
	Load(ctx context.Context, in *LoadRequest, opts ...grpc.CallOption) (*Principal, error)
	Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (Principals_WatchClient, error)
}

PrincipalsClient is the client API for Principals 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 NewPrincipalsClient

func NewPrincipalsClient(cc grpc.ClientConnInterface) PrincipalsClient

type PrincipalsServer

type PrincipalsServer interface {
	Ensure(context.Context, *EnsureRequest) (*EnsureResponse, error)
	List(*emptypb.Empty, Principals_ListServer) error
	Load(context.Context, *LoadRequest) (*Principal, error)
	Watch(*WatchRequest, Principals_WatchServer) error
	// contains filtered or unexported methods
}

PrincipalsServer is the server API for Principals service. All implementations must embed UnimplementedPrincipalsServer for forward compatibility

type Principals_ListClient

type Principals_ListClient interface {
	Recv() (*Principal, error)
	grpc.ClientStream
}

type Principals_ListServer

type Principals_ListServer interface {
	Send(*Principal) error
	grpc.ServerStream
}

type Principals_WatchClient

type Principals_WatchClient interface {
	Recv() (*Principal, error)
	grpc.ClientStream
}

type Principals_WatchServer

type Principals_WatchServer interface {
	Send(*Principal) error
	grpc.ServerStream
}

type TokenStatus

type TokenStatus int32
const (
	// The token has not (yet) been validated.
	TokenStatus_UNKNOWN TokenStatus = 0
	// The token should be considered valid until the refresh_after time.
	TokenStatus_VALID TokenStatus = 1
	// The token is being refreshed by another instance.  It should be
	// considered valid until the listed refresh time, at which point it
	// should be refreshed again.
	TokenStatus_REFRESHING TokenStatus = 2
	// The token could not be revalidated and no further attempts should
	// be made.
	TokenStatus_PERMANENT_FAILURE TokenStatus = 3
)

func (TokenStatus) Descriptor

func (TokenStatus) Enum

func (x TokenStatus) Enum() *TokenStatus

func (TokenStatus) EnumDescriptor deprecated

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

Deprecated: Use TokenStatus.Descriptor instead.

func (TokenStatus) Number

func (x TokenStatus) Number() protoreflect.EnumNumber

func (TokenStatus) String

func (x TokenStatus) String() string

func (TokenStatus) Type

type UnimplementedPrincipalsServer

type UnimplementedPrincipalsServer struct {
}

UnimplementedPrincipalsServer must be embedded to have forward compatible implementations.

func (UnimplementedPrincipalsServer) Ensure

func (UnimplementedPrincipalsServer) List

func (UnimplementedPrincipalsServer) Load

func (UnimplementedPrincipalsServer) Watch

type UnsafePrincipalsServer

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

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

type WatchRequest

type WatchRequest struct {
	Principal *ID                  `protobuf:"bytes,1,opt,name=principal,proto3" json:"principal,omitempty"`
	Duration  *durationpb.Duration `protobuf:"bytes,2,opt,name=duration,proto3" json:"duration,omitempty"`
	// contains filtered or unexported fields
}

func (*WatchRequest) Descriptor deprecated

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

Deprecated: Use WatchRequest.ProtoReflect.Descriptor instead.

func (*WatchRequest) GetDuration

func (x *WatchRequest) GetDuration() *durationpb.Duration

func (*WatchRequest) GetPrincipal

func (x *WatchRequest) GetPrincipal() *ID

func (*WatchRequest) ProtoMessage

func (*WatchRequest) ProtoMessage()

func (*WatchRequest) ProtoReflect

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

func (*WatchRequest) Reset

func (x *WatchRequest) Reset()

func (*WatchRequest) String

func (x *WatchRequest) String() string

Jump to

Keyboard shortcuts

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