metadata

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinaryValue

type BinaryValue struct {
	// Value contains the binary data for the current value.
	//
	// required: true
	// in: body
	// swagger:strfmt: byte
	Value []byte `json:"value"`
	// Sensitive indicates that the metadata value contains sensitive data and should not be transmitted to
	// servers unnecessarily.
	//
	// required: false
	// in: body
	Sensitive bool `json:"sensitive"`
}

BinaryValue is a value containing binary data. The value is a binary data type.

swagger:model BinaryMetadataValue

type ChannelMetadata

type ChannelMetadata struct {
	Connection ConnectionAuthenticatedMetadata `json:"connection"`

	// ChannelID signals the unique number of the channel within the connection.
	ChannelID uint64 `json:"channelID"`
}

type ConnectionAuthPendingMetadata

type ConnectionAuthPendingMetadata struct {
	ConnectionMetadata `json:",inline"`

	// ClientVersion contains the version string the connecting client sent if any. May be empty if the client did not
	// provide a client version.
	//
	// required: false
	// in: body
	ClientVersion string `json:"clientVersion"`

	// Username is the username provided on login by the client. This may, but must not necessarily match the
	// authenticated username.
	//
	// required: true
	// in: body
	Username string `json:"username"`
}

ConnectionAuthPendingMetadata is a variant of ConnectionMetadata which is used when the client has already provided a Username, but the authentication has not completed yet.

swagger:model ConnectionAuthPendingMetadata

func NewTestAuthenticatingMetadata

func NewTestAuthenticatingMetadata(username string) ConnectionAuthPendingMetadata

func (ConnectionAuthPendingMetadata) AuthFailed

AuthFailed creates a copy after a failed authentication to be passed along with an authentication failure.

func (ConnectionAuthPendingMetadata) Authenticated

Authenticated creates a copy after authentication.

type ConnectionAuthenticatedMetadata

type ConnectionAuthenticatedMetadata struct {
	ConnectionAuthPendingMetadata `json:",inline"`

	// AuthenticatedUsername contains the username that was actually verified. This may differ from LoginUsername when,
	// for example OAuth2 or Kerberos authentication is used. This field is empty until the authentication phase is
	// completed.
	//
	// required: false
	// in: body
	AuthenticatedUsername string `json:"authenticatedUsername,omitempty"`
}

ConnectionAuthenticatedMetadata is a variant of ConnectionMetadata which is used once the authentication has been completed. It contains the AuthenticatedUsername provided by the authentication system.

func (ConnectionAuthenticatedMetadata) Channel

func (meta ConnectionAuthenticatedMetadata) Channel(channelID uint64) ChannelMetadata

func (*ConnectionAuthenticatedMetadata) Merge

Merge merges the newMeta into the current metadata structure. If environment, files, or metadata are set, these override the current variable. If they are not set, the result is kept.

type ConnectionMetadata

type ConnectionMetadata struct {
	// RemoteAddress is the IP address and port of the user trying to authenticate.
	//
	// required: true
	// in: body
	RemoteAddress RemoteAddress `json:"remoteAddress"`

	// ConnectionID is an opaque ID to identify the SSH connection in question.
	//
	// required: true
	// in: body
	ConnectionID string `json:"connectionId"`

	// Metadata is a set of key-value pairs that carry additional information from the authentication and configuration
	// system to the backends. Backends can expose this information as container labels, environment variables, or
	// other places.
	//
	// required: false
	// in: body
	Metadata map[string]Value `json:"metadata,omitempty"`

	// Environment is a set of key-value pairs provided by the authentication or configuration system and may be
	// exposed by the backend.
	//
	// required: false
	// in: body
	Environment map[string]Value `json:"environment,omitempty"`

	// Files is a key-value pair of file names and their content set by the authentication or configuration system
	// and consumed by the backend.
	//
	// required: false
	// in: body
	Files map[string]BinaryValue `json:"files,omitempty"`
}

ConnectionMetadata holds a metadata structure passed around with a metadata. Its main purpose is to allow an authentication or authorization module to configure data exposed to the configuration server or the backend.

swagger:model ConnectionMetadata

func NewTestMetadata

func NewTestMetadata() ConnectionMetadata

NewTestMetadata provides a metadata set useful for testing.

func (*ConnectionMetadata) GetEnvironment

func (meta *ConnectionMetadata) GetEnvironment() map[string]Value

GetEnvironment returns an editable files map.

func (*ConnectionMetadata) GetFiles

func (meta *ConnectionMetadata) GetFiles() map[string]BinaryValue

GetFiles returns an editable files map.

func (*ConnectionMetadata) GetMetadata

func (meta *ConnectionMetadata) GetMetadata() map[string]Value

GetMetadata returns an editable metadata map.

func (*ConnectionMetadata) Merge

func (meta *ConnectionMetadata) Merge(newMeta ConnectionMetadata)

Merge merges a metadata object into the current one. If the newMeta contains environment, files, or metadata, they will override the current content.

func (ConnectionMetadata) StartAuthentication

func (meta ConnectionMetadata) StartAuthentication(
	clientVersion string,
	username string,
) ConnectionAuthPendingMetadata

type RemoteAddress

type RemoteAddress net.TCPAddr

RemoteAddress is an overlay for net.TCPAddr to provide JSON marshalling and unmarshalling.

func (RemoteAddress) AddrPort

func (r RemoteAddress) AddrPort() netip.AddrPort

AddrPort returns the netip.AddrPort component of this address.

func (RemoteAddress) MarshalJSON

func (r RemoteAddress) MarshalJSON() ([]byte, error)

MarshalJSON provides custom JSON marshalling to a string.

func (RemoteAddress) MarshalText

func (r RemoteAddress) MarshalText() ([]byte, error)

MarshalText provides custom marshalling to a string.

func (RemoteAddress) Network

func (r RemoteAddress) Network() string

Network returns the network type ("tcp") of this address.

func (RemoteAddress) String

func (r RemoteAddress) String() string

String returns a string representation of this address.

func (*RemoteAddress) UnmarshalJSON

func (r *RemoteAddress) UnmarshalJSON(input []byte) error

UnmarshalJSON provides custom JSON unmarshalling from a string.

func (*RemoteAddress) UnmarshalText

func (r *RemoteAddress) UnmarshalText(input []byte) error

UnmarshalText provides custom unmarshalling from a string.

type Value

type Value struct {
	// Value contains the string for the current value.
	Value string `json:"value"`
	// Sensitive indicates that the metadata value contains sensitive data and should not be transmitted to
	// servers unnecessarily.
	Sensitive bool `json:"sensitive"`
}

Value is a string value with extra data connected to it. The value is a string type.

swagger:model MetadataValue

Jump to

Keyboard shortcuts

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