authmetadata

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: MPL-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FieldSchema

func FieldSchema(fields *Fields) *framework.FieldSchema

FieldSchema takes the default and additionally available fields, and uses them to generate a verbose description regarding how to use the "auth_metadata" field.

Types

type Fields

type Fields struct {
	// The field name as it'll be reflected in the user-facing
	// schema.
	FieldName string

	// Default is a list of the default fields that should
	// be included if a user sends "default" in their list
	// of desired fields. These fields should all have a
	// low rate of change because each change can incur a
	// write to storage.
	Default []string

	// AvailableToAdd is a list of fields not included by
	// default, that the user may include.
	AvailableToAdd []string
}

Fields is for configuring a back-end's available default and additional fields. These are used for providing a verbose field description, and for parsing user input.

type Handler

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

func NewHandler

func NewHandler(fields *Fields) *Handler

func (*Handler) AuthMetadata

func (h *Handler) AuthMetadata() []string

AuthMetadata is intended to be used on config reads. It gets an explicit list of all the user's configured fields that are being added to auth metadata.

func (*Handler) MarshalJSON

func (h *Handler) MarshalJSON() ([]byte, error)

func (*Handler) ParseAuthMetadata

func (h *Handler) ParseAuthMetadata(data *framework.FieldData) error

ParseAuthMetadata is intended to be used on config create/update. It takes a user's selected fields (or lack thereof), converts it to a list of explicit fields, and adds it to the Handler for later storage.

func (*Handler) PopulateDesiredMetadata

func (h *Handler) PopulateDesiredMetadata(auth *logical.Auth, available map[string]string) error

PopulateDesiredMetadata is intended to be used during login just before returning an auth. It takes the available auth metadata and, if the auth should have it, adds it to the auth's metadata.

func (*Handler) UnmarshalJSON

func (h *Handler) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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