credentialhelper

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultKeyRewriter added in v0.0.2

func DefaultKeyRewriter(serverURL string) string

DefaultKeyRewriter can be used to remove the "https://", "http://" prefix and any trailing forward-slash "/". Additionally it will replace colons ":" in an IP address with "-port-".

Example:

https://mydomain.com/key -> mydomain.com/key
http://182.31.42.33:8455/key -> 182.31.42.33-port-8455/key
https://io.docker.com/access-token/ -> io.docker.com/access-token

func New

func New(logger plugin.Logger, opts ...Options) (plugin.Plugin, error)

Types

type KeyRewriter

type KeyRewriter func(serverURL, username string) (plugin.ID, error)

KeyRewriter provides a credential-helper credential username and ID (a server URL). The server URL can consist of an http or https prefix and may end with a trailing forward-slash.

For example:

{
  "ServerURL": "http://127.0.0.1/test",
  "Username": "bob"
}

Errors returned by a KeyRewriter will simply log and the current credential will be skipped when [GetSecrets] is called.

It is recommended to use DefaultKeyRewriter for credential-helper credentials when writing custom rules in your KeyRewriter.

type Options

type Options func(*credentialHelperStore)

func WithKeyRewriter

func WithKeyRewriter(rewriter KeyRewriter) Options

func WithShellProgramFunc

func WithShellProgramFunc(f client.ProgramFunc) Options

Jump to

Keyboard shortcuts

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