credential

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BasicAuth string = "basic_auth"
)
View Source
const SecretKey = "credential_secret"

Variables

This section is empty.

Functions

func GetOrInitSecret

func GetOrInitSecret() ([]byte, error)

func InitSecret

func InitSecret(ks keystore2.Keystore, secret []byte) error

func RegisterChangeEvent

func RegisterChangeEvent(evt ChangeEvent)

func TriggerChangeEvent

func TriggerChangeEvent(credentials *Credential)

Types

type ChangeEvent

type ChangeEvent func(credentials *Credential)

type Credential

type Credential struct {
	orm.ORMObjectBase
	Name    string                 `json:"name" elastic_mapping:"name:{type:keyword,copy_to:search_text}"`
	Type    string                 `json:"type" elastic_mapping:"type:{type:keyword}"`
	Tags    []string               `json:"tags" elastic_mapping:"category:{type:keyword,copy_to:search_text}"`
	Payload map[string]interface{} `json:"payload" elastic_mapping:"payload:{type:object,enabled:false}"`
	Encrypt struct {
		Type   string                 `json:"type"`
		Params map[string]interface{} `json:"params"`
	} `json:"encrypt" elastic_mapping:"encrypt:{type:object,enabled:false}"`
	SearchText string `` /* 138-byte string literal not displayed */

	Invalid bool `json:"invalid" elastic_mapping:"invalid:{type:boolean}"`
	// contains filtered or unexported fields
}

func (*Credential) Decode

func (cred *Credential) Decode() (interface{}, error)

func (*Credential) DecodeBasicAuth

func (cred *Credential) DecodeBasicAuth() (*model.BasicAuth, error)

func (*Credential) Encode

func (cred *Credential) Encode() error

func (*Credential) SetSecret

func (cred *Credential) SetSecret(secret []byte)

func (*Credential) Validate

func (cred *Credential) Validate() error

Jump to

Keyboard shortcuts

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