Help us shape the future of Go! Take the 2026 Go Developer Survey

pat

package
v0.18.4 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2025 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllowedScopes = []string{"manage", "scan"}

Functions

func HexPubKeyToECDSA added in v0.5.14

func HexPubKeyToECDSA(hexPubKey string) ecdsa.PublicKey

func HexTokenToECDSA added in v0.5.14

func HexTokenToECDSA(hexToken string) (ecdsa.PrivateKey, ecdsa.PublicKey, error)

func SignRequest

func SignRequest(hexPrivKey string, req *http.Request) error

Types

type CreateRequest

type CreateRequest struct {
	Description string `json:"description"`
	PubKey      string `json:"pubKey"`
	Scopes      string `json:"scopes"`
}

func (CreateRequest) ToModel

func (p CreateRequest) ToModel(userID string) models.PAT

type PatController

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

func NewHTTPController added in v0.17.0

func NewHTTPController(repository core.PersonalAccessTokenRepository) *PatController

func (*PatController) Create

func (p *PatController) Create(c core.Context) error

func (*PatController) Delete

func (p *PatController) Delete(c core.Context) error

func (*PatController) List

func (p *PatController) List(c core.Context) error

func (*PatController) RevokeByPrivateKey added in v0.17.0

func (p *PatController) RevokeByPrivateKey(c core.Context) error

type PatService

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

func NewPatService

func NewPatService(repository core.PersonalAccessTokenRepository) *PatService

func (*PatService) RevokeByPrivateKey added in v0.17.0

func (p *PatService) RevokeByPrivateKey(privKey string) error

func (*PatService) VerifyRequestSignature

func (p *PatService) VerifyRequestSignature(req *http.Request) (string, string, error)

type RevokeByPrivateKeyRequest added in v0.17.0

type RevokeByPrivateKeyRequest struct {
	PrivateKey string `json:"privkey" validate:"required"`
}

Jump to

Keyboard shortcuts

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