passworddepot

package
v0.9.17 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	DoRequestError = "error: do request: %w"
)

Variables

This section is empty.

Functions

func ReadAndUnmarshal

func ReadAndUnmarshal(resp *http.Response, target any) error

Types

type API

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

func NewAPI

func NewAPI(ctx context.Context, baseURL, username, password, hostPort string) (*API, error)

func (*API) GetSecret

func (api *API) GetSecret(database, secretName string) (SecretEntry, error)

func (*API) ListDatabases

func (api *API) ListDatabases() (Databases, error)

func (*API) ListSecrets

func (api *API) ListSecrets(dbFingerprint, folder string) (DatabaseEntries, error)

type AccessData

type AccessData struct {
	ClientID    string `json:"client_id"`
	AccessToken string `json:"access_token"`
}

type Client

type Client interface {
	GetSecret(database, key string) (SecretEntry, error)
}

type DatabaseEntries

type DatabaseEntries struct {
	Name         string  `json:"name"`
	Parent       string  `json:"parent"`
	Entries      []Entry `json:"entries"`
	Infoclasses  string  `json:"infoclasses"`
	Reasondelete string  `json:"reasondelete"`
}

type Databases

type Databases struct {
	Databases []struct {
		Name         string    `json:"name"`
		Fingerprint  string    `json:"fingerprint"`
		Date         time.Time `json:"date"`
		Rights       string    `json:"rights"`
		Reasondelete string    `json:"reasondelete"`
	} `json:"databases"`
	Infoclasses          string `json:"infoclasses"`
	Policyforce          string `json:"policyforce"`
	Policyminlength      string `json:"policyminlength"`
	Policyincludeatleast string `json:"policyincludeatleast"`
	Policymingroups      string `json:"policymingroups"`
	Policyselectedgroups string `json:"policyselectedgroups"`
}

type Entry

type Entry struct {
	Name        string    `json:"name"`
	Login       string    `json:"login"`
	Password    string    `json:"pass"`
	URL         string    `json:"url"`
	Importance  string    `json:"importance"`
	Date        time.Time `json:"date"`
	Icon        string    `json:"icon"`
	Secondeye   string    `json:"secondeye"`
	Fingerprint string    `json:"fingerprint"`
	Rights      string    `json:"rights"`
	Itemclass   string    `json:"itemclass"`
}

type HTTPClient

type HTTPClient interface {
	Do(*http.Request) (*http.Response, error)
}

type PasswordDepot

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

PasswordDepot Provider struct with reference to a PasswordDepot client and a projectID.

func NewPasswordDepotProvider

func NewPasswordDepotProvider() *PasswordDepot

Function newPasswordDepotProvider returns a reference to a new instance of a 'PasswordDepot' struct.

func (*PasswordDepot) Capabilities

func (*PasswordDepot) Close

func (p *PasswordDepot) Close(_ context.Context) error

func (*PasswordDepot) DeleteSecret

func (*PasswordDepot) GetAllSecrets

func (p *PasswordDepot) GetAllSecrets(_ context.Context, _ esv1beta1.ExternalSecretFind) (map[string][]byte, error)

func (*PasswordDepot) GetSecret

func (*PasswordDepot) GetSecretMap

func (*PasswordDepot) NewClient

func (p *PasswordDepot) NewClient(ctx context.Context, store esv1beta1.GenericStore, kube kclient.Client, namespace string) (esv1beta1.SecretsClient, error)

Method on PasswordDepot Provider to set up client with credentials and populate projectID.

func (*PasswordDepot) PushSecret

func (*PasswordDepot) SecretExists

func (*PasswordDepot) Validate

func (p *PasswordDepot) Validate() (esv1beta1.ValidationResult, error)

func (*PasswordDepot) ValidateStore

type Provider

type Provider struct{}

type SecretEntry

type SecretEntry struct {
	Name        string    `json:"name"`
	Fingerprint string    `json:"fingerprint"`
	Itemclass   string    `json:"itemclass"`
	Login       string    `json:"login"`
	Pass        string    `json:"pass"`
	URL         string    `json:"url"`
	Importance  string    `json:"importance"`
	Date        time.Time `json:"date"`
	Comment     string    `json:"comment"`
	Expirydate  string    `json:"expirydate"`
	Tags        string    `json:"tags"`
	Author      string    `json:"author"`
	Category    string    `json:"category"`
	Icon        string    `json:"icon"`
	Secondeye   string    `json:"secondeye"`
	Secondpass  string    `json:"secondpass"`
	Template    string    `json:"template"`
	Acm         string    `json:"acm"`
	Paramstr    string    `json:"paramstr"`
	Loginid     string    `json:"loginid"`
	Passid      string    `json:"passid"`
	Donotaddon  string    `json:"donotaddon"`
	Markassafe  string    `json:"markassafe"`
	Safemode    string    `json:"safemode"`
}

func (SecretEntry) ToMap

func (s SecretEntry) ToMap() map[string][]byte

Directories

Path Synopsis
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

Jump to

Keyboard shortcuts

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