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

auth

package
v1.0.29 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSession = errors.New("no stored auth session")

Functions

func OpenBrowser added in v1.0.27

func OpenBrowser(url string) error

Types

type ClerkClient

type ClerkClient struct {
	Issuer       string
	ClientID     string
	Audience     string
	Scopes       string
	CallbackPort int
	HTTPClient   *http.Client
}

func (*ClerkClient) Login

func (c *ClerkClient) Login(ctx context.Context) (*Session, error)

func (*ClerkClient) RefreshSession

func (c *ClerkClient) RefreshSession(ctx context.Context, session *Session) (*Session, error)

func (*ClerkClient) RevokeRefreshToken

func (c *ClerkClient) RevokeRefreshToken(ctx context.Context, refreshToken string) error

type Session

type Session struct {
	AccessToken    string    `json:"access_token"`
	RefreshToken   string    `json:"refresh_token"`
	TokenType      string    `json:"token_type"`
	Scope          string    `json:"scope"`
	ExpiresAt      time.Time `json:"expires_at"`
	OrganizationID string    `json:"organization_id,omitempty"`
	KnownOrgIDs    []string  `json:"known_org_ids,omitempty"`
}

func (*Session) ExpiresSoon

func (s *Session) ExpiresSoon(leeway time.Duration) bool

type SessionStore

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

func NewSessionStore

func NewSessionStore(service string) (*SessionStore, error)

func (*SessionStore) Clear

func (s *SessionStore) Clear(_ context.Context) error

func (*SessionStore) Load

func (s *SessionStore) Load(_ context.Context) (*Session, error)

func (*SessionStore) Save

func (s *SessionStore) Save(_ context.Context, session *Session) error

Jump to

Keyboard shortcuts

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