auth

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OAuth2Provider

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

OAuth2Provider uses client credentials flow to obtain and cache tokens. It proactively refreshes the token before expiry.

func NewOAuth2Provider

func NewOAuth2Provider(baseURL, clientID, clientSecret string) *OAuth2Provider

func (*OAuth2Provider) GetToken

func (p *OAuth2Provider) GetToken(ctx context.Context) (string, error)

func (*OAuth2Provider) Name

func (p *OAuth2Provider) Name() string

type PlatformOAuth2Provider

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

PlatformOAuth2Provider uses the Jamf Platform Gateway for authentication. Instead of authenticating directly against a Jamf Pro instance, it obtains tokens from a regional platform gateway (e.g., https://us.api.platform.jamf.com) and routes all API requests through that gateway using tenant-scoped URL paths.

func NewPlatformOAuth2Provider

func NewPlatformOAuth2Provider(baseURL, clientID, clientSecret, tenantID string) *PlatformOAuth2Provider

func (*PlatformOAuth2Provider) GetToken

func (p *PlatformOAuth2Provider) GetToken(ctx context.Context) (string, error)

func (*PlatformOAuth2Provider) Name

func (p *PlatformOAuth2Provider) Name() string

func (*PlatformOAuth2Provider) TenantID

func (p *PlatformOAuth2Provider) TenantID() string

TenantID returns the tenant identifier used for gateway URL path rewriting.

type Provider

type Provider interface {
	// GetToken returns a valid authentication token
	GetToken(ctx context.Context) (string, error)
	// Name returns the provider name for logging
	Name() string
}

Provider defines the interface for authentication providers

type TokenProvider

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

TokenProvider uses a pre-existing bearer token

func NewTokenProvider

func NewTokenProvider(token string) *TokenProvider

func (*TokenProvider) GetToken

func (p *TokenProvider) GetToken(ctx context.Context) (string, error)

func (*TokenProvider) Name

func (p *TokenProvider) Name() string

Jump to

Keyboard shortcuts

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