Documentation ¶
Overview ¶
Package session implements session attributes for stream connections.
Index ¶
Constants ¶
View Source
const ( AttributeMetadataKey = "x-session-attribute" AttributeLabelKey = "opni.io/session-attribute" KeyLength = 32 )
View Source
const (
AttributesKey sessionAttributesKeyType = "session_attributes"
)
View Source
const (
DomainString = "session auth v1"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Attribute ¶
type Attribute interface { // Name returns the attribute name. This should be a unique identifier. Name() string }
func NewAttribute ¶
type ClientChallenge ¶
type ClientChallenge struct {
// contains filtered or unexported fields
}
func NewClientChallenge ¶
func NewClientChallenge(kr keyring.Keyring) (*ClientChallenge, error)
func (*ClientChallenge) Attributes ¶
func (a *ClientChallenge) Attributes() []string
func (*ClientChallenge) DoChallenge ¶
func (*ClientChallenge) HasAttributes ¶
Matches challenges.ConditionFunc
func (*ClientChallenge) InterceptContext ¶
func (a *ClientChallenge) InterceptContext(ctx context.Context) context.Context
type SecretAttribute ¶
type SecretAttribute interface { Attribute // Given a challenge string, Solve will compute a MAC using an // implementation-specific secret key and return the result. Solve(id string, challenge []byte) []byte // Verify will check if a mac is valid for a given id and challenge. Verify(id string, challenge []byte, response []byte) bool }
func NewSecretAttribute ¶
func NewSecretAttribute(name string, key []byte) (SecretAttribute, error)
type ServerChallenge ¶
type ServerChallenge struct { ServerChallengeOptions // contains filtered or unexported fields }
func NewServerChallenge ¶
func NewServerChallenge(kr keyring.Keyring, opts ...ServerChallengeOption) (*ServerChallenge, error)
func (*ServerChallenge) Attributes ¶
func (a *ServerChallenge) Attributes() []string
func (*ServerChallenge) DoChallenge ¶
func (*ServerChallenge) HasAttributes ¶
Matches challenges.ConditionFunc
func (*ServerChallenge) InterceptContext ¶
func (a *ServerChallenge) InterceptContext(ctx context.Context) context.Context
type ServerChallengeOption ¶
type ServerChallengeOption func(*ServerChallengeOptions)
func WithAttributeRequestLimit ¶
func WithAttributeRequestLimit(attributeRequestLimit int) ServerChallengeOption
type ServerChallengeOptions ¶
type ServerChallengeOptions struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.