Documentation ¶
Index ¶
- func FieldSchema(fields *Fields) *framework.FieldSchema
- type Fields
- type Handler
- func (h *Handler) AuthMetadata() []string
- func (h *Handler) MarshalJSON() ([]byte, error)
- func (h *Handler) ParseAuthMetadata(data *framework.FieldData) error
- func (h *Handler) PopulateDesiredMetadata(auth *logical.Auth, available map[string]string) error
- func (h *Handler) UnmarshalJSON(data []byte) error
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 (*Handler) AuthMetadata ¶
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 (*Handler) ParseAuthMetadata ¶
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 ¶
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.