core

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2021 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GitCommit     string //nolint:gochecknoglobals
	StsVersion    string //nolint:gochecknoglobals
	BuiltTime     string //nolint:gochecknoglobals
	OsArch        string //nolint:gochecknoglobals
	RcloneVersion string //nolint:gochecknoglobals
)

Functions

func CacheDir

func CacheDir() (string, error)

func CheckExeFile added in v1.0.6

func CheckExeFile(rcloneFile string, originalData []byte) error

func CreateHash

func CreateHash(key string) string

func Decrypt

func Decrypt(data []byte, password *memguard.Enclave) []byte

func Encrypt

func Encrypt(data []byte, password *memguard.Enclave) []byte

func ExePath

func ExePath() (string, error)

func Execute

func Execute()

Execute of the sts-wire command.

func MountVolume

func MountVolume(instance string, remotePath string, localPath string, configPath string) (*exec.Cmd, chan error, string, error)

func PrepareRclone

func PrepareRclone() error

func RandomState

func RandomState() string

Returns a base64 encoded random 32 byte string.

func RcloneLogErrors added in v1.0.5

func RcloneLogErrors(logPath string) chan string

func WriteReport added in v1.1.0

func WriteReport(mainErr interface{})

Types

type AssumeRoleWithWebIdentityResponse

type AssumeRoleWithWebIdentityResponse struct {
	XMLName          xml.Name          `xml:"https://sts.amazonaws.com/doc/2011-06-15/ AssumeRoleWithWebIdentityResponse" json:"-"`
	Result           WebIdentityResult `xml:"AssumeRoleWithWebIdentityResult"`
	ResponseMetadata struct {
		RequestID string `xml:"RequestId,omitempty"`
	} `xml:"ResponseMetadata,omitempty"`
}

AssumeRoleWithWebIdentityResponse the struct of the STS WebIdentity call response.

type AssumedRoleUser

type AssumedRoleUser struct {
	Arn           string
	AssumedRoleID string `xml:"AssumeRoleId"`
}

AssumedRoleUser - The identifiers for the temporary security credentials that the operation returns. Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumedRoleUser

type ClientResponse

type ClientResponse struct {
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
	Endpoint     string `json:"registration_client_uri"`
}

type GetInputWrapper

type GetInputWrapper struct {
	Scanner bufio.Reader
}

func (*GetInputWrapper) GetInputString

func (t *GetInputWrapper) GetInputString(question string, def string) (text string, err error)

func (*GetInputWrapper) GetPassword

func (t *GetInputWrapper) GetPassword(question string, only4Decription bool) (password *memguard.Enclave, err error)

type IAMClientConfig

type IAMClientConfig struct {
	CallbackURL string
	Host        string
	Port        int
	ClientName  string
}

type IAMCreds

type IAMCreds struct {
	AccessToken  string
	RefreshToken string
}

IAMCreds ..

type IAMProvider

type IAMProvider struct {
	StsEndpoint       string
	HTTPClient        *http.Client
	Token             string
	Creds             *AssumeRoleWithWebIdentityResponse
	RefreshTokenRenew int
}

IAMProvider credential provider for oidc.

func (*IAMProvider) IsExpired

func (t *IAMProvider) IsExpired() bool

IsExpired test.

func (*IAMProvider) Retrieve

func (t *IAMProvider) Retrieve() (credentials.Value, error)

Retrieve credentials.

type InitClientConfig

type InitClientConfig struct {
	ConfDir        string
	ClientConfig   IAMClientConfig
	Scanner        GetInputWrapper
	HTTPClient     http.Client
	IAMServer      string
	ClientTemplate string
	NoPWD          bool
}

func (*InitClientConfig) InitClient

func (t *InitClientConfig) InitClient(instance string) (endpoint string, clientResponse ClientResponse, passwd *memguard.Enclave, err error)

type RCloneStruct

type RCloneStruct struct {
	Address  string
	Instance string
}

RCloneStruct ..

type RefreshTokenStruct

type RefreshTokenStruct struct {
	RefreshToken string `json:"refresh_token"`
	AccessToken  string `json:"access_token"`
}

type Server

type Server struct {
	Client            InitClientConfig
	Instance          string
	S3Endpoint        string
	RemotePath        string
	LocalPath         string
	Endpoint          string
	Response          ClientResponse
	RefreshTokenRenew int
	// contains filtered or unexported fields
}

Server ..

func (*Server) RefreshToken added in v1.0.8

func (s *Server) RefreshToken(clientResponse ClientResponse, credsIAM IAMCreds, endpoint string)

func (*Server) Start

func (s *Server) Start() (ClientResponse, IAMCreds, string, error)

Start ..

func (*Server) UpdateTokenLoop

func (s *Server) UpdateTokenLoop(clientResponse ClientResponse, credsIAM IAMCreds, endpoint string)

type WebIdentityResult

type WebIdentityResult struct {
	AssumedRoleUser             AssumedRoleUser  `xml:",omitempty"`
	Audience                    string           `xml:",omitempty"`
	Credentials                 auth.Credentials `xml:",omitempty"`
	PackedPolicySize            int              `xml:",omitempty"`
	Provider                    string           `xml:",omitempty"`
	SubjectFromWebIdentityToken string           `xml:",omitempty"`
}

WebIdentityResult - Contains the response to a successful AssumeRoleWithWebIdentity request, including temporary credentials that can be used to make MinIO API requests.

Jump to

Keyboard shortcuts

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