auth

package
v0.72.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: BSD-3-Clause, AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package auth contains exported proxy auth values. These are used to ensure coherent usage across management and proxy implementations.

Index

Constants

View Source
const (
	SessionCookieName    = "nb_session"
	DefaultSessionExpiry = 24 * time.Hour
	SessionJWTIssuer     = "netbird-management"
)

Variables

This section is empty.

Functions

func ResolveProto

func ResolveProto(forwardedProto string, conn *tls.ConnectionState) string

ResolveProto determines the protocol scheme based on the forwarded proto configuration. When set to "http" or "https" the value is used directly. Otherwise TLS state is used: if conn is non-nil "https" is returned, else "http".

func ValidateSessionJWT

func ValidateSessionJWT(tokenString, domain string, publicKey ed25519.PublicKey) (userID, email, method string, groups, groupNames []string, err error)

ValidateSessionJWT validates a session JWT and returns the user ID, the user's email (when carried), the authentication method, any embedded group memberships, and the parallel group display names. email, groups, and groupNames may be empty for tokens minted before those claims were introduced. groupNames pairs positionally with groups.

Types

type Method

type Method string
const (
	MethodPassword Method = "password"
	MethodPIN      Method = "pin"
	MethodOIDC     Method = "oidc"
	MethodHeader   Method = "header"
)

func (Method) String

func (m Method) String() string

Jump to

Keyboard shortcuts

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