auth

package
v0.0.186 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GithubJWTAudience = "nscloud.dev/inline-token"
)

Variables

View Source
var ErrRelogin = fnerrors.New("not logged in, please run `%s login`", name.CmdName)

Functions

func GenerateToken added in v0.0.136

func GenerateToken(ctx context.Context) (string, error)

func GenerateTokenFromUserAuth added in v0.0.165

func GenerateTokenFromUserAuth(ctx context.Context, userAuth *UserAuth) (string, error)

func RemoveTenantToken added in v0.0.165

func RemoveTenantToken(ctx context.Context) error

func RemoveUser added in v0.0.165

func RemoveUser(ctx context.Context) error

func StoreMarshalledUser added in v0.0.136

func StoreMarshalledUser(ctx context.Context, userAuthData []byte) error

func StoreTenantToken added in v0.0.145

func StoreTenantToken(token string) error

func StoreUser added in v0.0.136

func StoreUser(ctx context.Context, userAuth *UserAuth) (string, error)

Types

type Token added in v0.0.145

type Token struct {
	TenantToken string `json:"tenant_token,omitempty"`
}

func LoadTenantToken added in v0.0.145

func LoadTenantToken(ctx context.Context) (*Token, error)

func (*Token) Raw added in v0.0.165

func (t *Token) Raw() string

type UserAuth added in v0.0.136

type UserAuth struct {
	Username       string `json:"username,omitempty"`
	Org            string `json:"org,omitempty"` // The organization this user is acting as. Only really relevant for robot accounts which authenticate against a repository.
	InternalOpaque []byte `json:"opaque,omitempty"`

	Clerk          *clerk.State `json:"clerk,omitempty"`
	IsGithubAction bool         `json:"is_github_action,omitempty"`
}

func LoadUser added in v0.0.136

func LoadUser() (*UserAuth, error)

Jump to

Keyboard shortcuts

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