Documentation
¶
Index ¶
- type OAuthConfig
- type OAuthFlow
- func (o *OAuthFlow) ExchangeCode(ctx context.Context, code string) (*Token, error)
- func (o *OAuthFlow) GetAuthURL(state string) string
- func (o *OAuthFlow) GetSiteInfo(ctx context.Context, accessToken string) (*SiteInfo, error)
- func (o *OAuthFlow) RefreshToken(ctx context.Context, refreshToken string, existingToken *Token) (*Token, error)
- func (o *OAuthFlow) StartAuthServer(ctx context.Context) (*Token, error)
- type SiteInfo
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OAuthConfig ¶
OAuthConfig holds the credentials and scopes for an Atlassian OAuth flow.
type OAuthFlow ¶
type OAuthFlow struct {
// contains filtered or unexported fields
}
OAuthFlow handles the Atlassian OAuth 2.0 flow.
func NewOAuthFlow ¶
func NewOAuthFlow(cfg OAuthConfig) *OAuthFlow
NewOAuthFlow creates a new OAuthFlow with the given config.
func (*OAuthFlow) ExchangeCode ¶
ExchangeCode exchanges an authorization code for tokens.
func (*OAuthFlow) GetAuthURL ¶
GetAuthURL returns the URL to start the OAuth flow.
func (*OAuthFlow) GetSiteInfo ¶
GetSiteInfo fetches site info (CloudID and SiteURL) from the accessible-resources API.
type Token ¶
type Token struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
ExpiresAt time.Time `json:"expires_at"`
CloudID string `json:"cloud_id,omitempty"`
SiteURL string `json:"site_url,omitempty"`
}
Token holds Atlassian OAuth tokens (shared by Jira, Confluence, etc.)
Click to show internal directories.
Click to hide internal directories.