auth

package
v0.0.0-...-3279f0f Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2025 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClient

func GetClient(logger *slog.Logger, cfg *config.Config) (*http.Client, *oauth2.Token, error)

GetClient returns an authenticated http.Client and the corresponding token. It's used by the server at startup. It requires a valid, pre-existing token.

func LoadToken

func LoadToken(logger *slog.Logger, cfg *config.Config) (*oauth2.Token, error)

LoadToken retrieves a token from a file, if it doesn't exist it returns a nil token.

func Login

func Login(logger *slog.Logger, cfg *config.Config) error

func RevokeToken

func RevokeToken(logger *slog.Logger, cfg *config.Config) error

RevokeToken securely deletes the token file. It overwrites the file with zeros to prevent recovery of the sensitive token data, then closes the file, and finally removes it from the filesystem. This approach ensures that the file is properly handled for secure deletion, particularly on systems like Windows where a file must be closed before it can be removed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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