Documentation
¶
Index ¶
- Constants
- Variables
- func EnsureTokenValidAt(ctx context.Context, target time.Time) error
- func GenerateToken(ctx context.Context) (string, error)
- func GenerateTokenFromUserAuth(ctx context.Context, userAuth *UserAuth) (string, error)
- func StoreAdminToken(token string) error
- func StoreMarshalledUser(ctx context.Context, userAuthData []byte) error
- func StoreTenantToken(token string) error
- func StoreUser(ctx context.Context, userAuth *UserAuth) (string, error)
- type Token
- type UserAuth
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 EnsureTokenValidAt ¶ added in v0.0.192
func GenerateTokenFromUserAuth ¶ added in v0.0.165
func StoreAdminToken ¶ added in v0.0.191
func StoreMarshalledUser ¶ added in v0.0.136
func StoreTenantToken ¶ added in v0.0.145
Types ¶
type Token ¶ added in v0.0.145
type Token struct {
BearerToken string `json:"bearer_token,omitempty"`
}
func LoadTokenFromPath ¶ added in v0.0.191
func (*Token) UnmarshalJSON ¶ added in v0.0.191
TODO: remove when legacy token.json format is not used anymore.
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"` }
Click to show internal directories.
Click to hide internal directories.