vaultserver

package
v0.3.22 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 5 Imported by: ? modules, 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

Index

Constants

View Source
const (
	CloudUS = "bitwarden.com"
	CloudEU = "bitwarden.eu"
)

The official clouds, by the names ParseServer takes.

Variables

View Source
var ErrInsecureServer = errors.New("vault: the password hash and tokens would travel unencrypted")

ErrInsecureServer is a server URL that would carry secrets unencrypted.

Functions

func CheckTransport

func CheckTransport(u *url.URL) error

CheckTransport refuses a URL that would carry the password hash and the tokens unencrypted off this machine: http to anything but loopback.

Types

type Server

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

Server is where an account lives: an official cloud by its name, or a self-hosted server (or Vaultwarden) by its base URL, https unless it is on this machine. The zero Server is none.

func ParseServer

func ParseServer(s string) (Server, error)

ParseServer reads a server setting: CloudUS, CloudEU, or an http(s) base URL without a query or fragment. A URL CheckTransport refuses is an error matching ErrInsecureServer.

func (Server) MarshalText

func (s Server) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (Server) Redacted

func (s Server) Redacted() string

Redacted is String with any password in the URL masked, for a log.

func (Server) String

func (s Server) String() string

String is the cloud's name or the base URL.

func (*Server) UnmarshalText

func (s *Server) UnmarshalText(b []byte) error

UnmarshalText implements encoding.TextUnmarshaler, refusing what ParseServer refuses.

Jump to

Keyboard shortcuts

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