secrets

package
v0.3.28 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package secrets holds the credential-prompt contract shared by the NetworkManager secret agent and the VPN sign-ins that run inside it, the Go counterpart of crates/wayle-network's types/agent.rs and the VPN variants of error.rs.

It exists on its own so the sign-in protocols (package openconnect) and the agent (package network) depend on one definition of what a prompt is instead of on each other.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscreditsPassword

func DiscreditsPassword(err error) bool

DiscreditsPassword reports whether err is evidence against a stored password: only a refusal is (discredits_password).

Types

type AuthenticationFailedError

type AuthenticationFailedError struct{ Reason string }

AuthenticationFailedError is a gateway refusing an authentication, or asking for something lys-shell cannot do (VpnAuthenticationFailed). Its message is shown to the user verbatim; it discredits a cached password.

func (*AuthenticationFailedError) Error

func (e *AuthenticationFailedError) Error() string

type Field

type Field struct {
	// Key is the NM settings key this fills, e.g. "password", "psk".
	Key string
	// Label is the English label; the UI translates by key where it has
	// a string and falls back to this.
	Label string
	// Secret masks the input.
	Secret bool
}

Field is one credential NM (or a gateway) is missing, and how to ask for it (SecretField).

type Prompter

type Prompter interface {
	Prompt(ctx context.Context, req Request) (values map[string]string, ok bool)
}

Prompter shows a Request and waits for the user. It returns the values by key, or ok=false when the user dismissed the prompt or ctx ended first (the request was withdrawn or timed out); the form goes away in both cases.

type ProtocolUnsupportedError

type ProtocolUnsupportedError struct{ Reason string }

ProtocolUnsupportedError is a gateway answering in a shape lys-shell's sign-in does not recognise (VpnProtocolUnsupported): the agent turns it into NM's NoSecrets so another agent or the plugin's own dialog can try.

func (*ProtocolUnsupportedError) Error

func (e *ProtocolUnsupportedError) Error() string

type Request

type Request struct {
	// UUID of the connection profile the secrets are for.
	UUID string
	// Name is the profile's display name, for the prompt header.
	Name string
	// Setting is the settings block to fill: "vpn",
	// "802-11-wireless-security", "802-1x", ...
	Setting string
	// Message is the service's own wording (a 2FA challenge), empty
	// when there is none.
	Message string
	// Fields is what to ask for.
	Fields []Field
}

Request is a credential prompt waiting on the user (SecretRequest).

type SignInIncompleteError

type SignInIncompleteError struct{ Reason string }

SignInIncompleteError is a sign-in that ended without the gateway refusing the password: a dismissed prompt, an unreachable gateway, a rejected later factor (VpnSignInIncomplete). The cached password survives it.

func (*SignInIncompleteError) Error

func (e *SignInIncompleteError) Error() string

Jump to

Keyboard shortcuts

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