package manager
import "github.com/docker/cli/internal/oauth/manager"
Index ¶
- Variables
- type OAuthManager
- func New(options OAuthManagerOptions) *OAuthManager
- func NewManager(store credentials.Store) *OAuthManager
- func (m *OAuthManager) LoginDevice(ctx context.Context, w io.Writer) (*types.AuthConfig, error)
- func (m *OAuthManager) Logout(ctx context.Context) error
- type OAuthManagerOptions
Variables ¶
Types ¶
type OAuthManager ¶
type OAuthManager struct {
// contains filtered or unexported fields
}
OAuthManager is the manager responsible for handling authentication flows with the oauth tenant.
func New ¶
func New(options OAuthManagerOptions) *OAuthManager
func NewManager ¶
func NewManager(store credentials.Store) *OAuthManager
func (*OAuthManager) LoginDevice ¶
func (m *OAuthManager) LoginDevice(ctx context.Context, w io.Writer) (*types.AuthConfig, error)
LoginDevice launches the device authentication flow with the tenant, printing instructions to the provided writer and attempting to open the browser for the user to authenticate. After the user completes the browser login, LoginDevice uses the retrieved tokens to create a Hub PAT which is returned to the caller. The retrieved tokens are stored in the credentials store (under a separate key), and the refresh token is concatenated with the client ID.
func (*OAuthManager) Logout ¶
func (m *OAuthManager) Logout(ctx context.Context) error
Logout fetches the refresh token from the store and revokes it with the configured oauth tenant. The stored access and refresh tokens are then erased from the store. If the refresh token is not found in the store, an error is not returned.
type OAuthManagerOptions ¶
type OAuthManagerOptions struct { Store credentials.Store Audience string ClientID string Scopes []string Tenant string DeviceName string OpenBrowser func(string) error }
OAuthManagerOptions are the options used for New to create a new auth manager.
Source Files ¶
- Version
- v28.2.0-rc.1+incompatible
- Published
- May 19, 2025
- Platform
- js/wasm
- Imports
- 19 packages
- Last checked
- 23 minutes ago –
Tools for package owners.