config

package
v6.12.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertX25519Key

func ConvertX25519Key(ed25519_sk []byte) [32]byte

func EncryptedConfigExists added in v6.10.0

func EncryptedConfigExists() (bool, error)

func GetEncryptedConfigName

func GetEncryptedConfigName() (string, error)

func GetEncryptedContents

func GetEncryptedContents() (string, error)

func GetPassword

func GetPassword(newFile bool) ([]byte, error)

func ResetPassword

func ResetPassword() error

func SaveConfigContents

func SaveConfigContents(config *OSDFConfig) error

func SaveConfigContents_internal

func SaveConfigContents_internal(config *OSDFConfig, forcePassword bool) error

func SaveEncryptedContents

func SaveEncryptedContents(encContents []byte) error

func SavePassword

func SavePassword(password []byte) error

func TryGetPassword

func TryGetPassword() ([]byte, error)

Types

type OSDFConfig

type OSDFConfig struct {

	// Top-level OSDF object
	OSDF struct {
		// List of OAuth2 client configurations
		OauthClient []PrefixEntry `yaml:"oauth_client,omitempty"`
	} `yaml:"OSDF"`
}

func GetConfigContents

func GetConfigContents() (OSDFConfig, error)

type PrefixEntry

type PrefixEntry struct {
	// OSDF namespace prefix
	Prefix       string       `yaml:"prefix"`
	ClientID     string       `yaml:"client_id"`
	ClientSecret string       `yaml:"client_secret"`
	Tokens       []TokenEntry `yaml:"tokens,omitempty"`
}

type TokenEntry added in v6.10.0

type TokenEntry struct {
	Expiration   int64  `yaml:"expiration"`
	AccessToken  string `yaml:"access_token"`
	RefreshToken string `yaml:"refresh_token,omitempty"`
}

Jump to

Keyboard shortcuts

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