approvedevicecode

package
v1.46.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 6 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

This section is empty.

Variables

View Source
var ErrUnknownCode = errors.New("no login of the CLI waits for this code: it may have expired, run tide login again")

Functions

func Normalize

func Normalize(code string) string

Normalize is a user code as the base keeps it: upper case, without its dash nor spaces.

func Process

func Process(ctx context.Context, db bun.IDB, input Input) *run

Process allows, or refuses, the login of the CLI that shows the user code, for the account of ctx. A code decided, expired or unknown is ErrUnknownCode: the route counts those, the code must not be guessed.

Types

type Input

type Input struct {
	// UserCode is the code the CLI shows, in any case, with or without its dash.
	UserCode string `json:"user_code"`
	// Allow gives the CLI a token of the account; false refuses it.
	Allow bool `json:"allow"`
}

Jump to

Keyboard shortcuts

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