npmjsaccesstoken

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0, BSD-3-Clause, MIT Imports: 5 Imported by: 0

Documentation

Overview

Package npmjsaccesstoken contains a Veles Secret type and a Detector for npm.js Access Tokens (prefix `npm_`).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDetector

func NewDetector() veles.Detector

NewDetector returns a new simpletoken.Detector that matches npm.js access tokens.

func NewValidator

func NewValidator() *sv.Validator[pak]

NewValidator checks whether the given NpmJsAccessToken is valid.

It performs a GET request to the npm registry whoami endpoint using the access token in the Authorization header. If the request returns HTTP 200, the token is considered valid. If 401 Unauthorized, the token is invalid. Other errors return ValidationFailed.

Types

type NpmJsAccessToken

type NpmJsAccessToken struct {
	Token string
}

NpmJsAccessToken is a Veles Secret that holds relevant information for a DigitalOcean API key (prefix `dop_v1_`). DigitaloceanAPIToken represents an API key used to authenticate requests

Jump to

Keyboard shortcuts

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