Update dependencies (#2180)
* Update dependencies * Fix whatsmeow API changes
This commit is contained in:
31
vendor/github.com/slack-go/slack/oauth.go
generated
vendored
31
vendor/github.com/slack-go/slack/oauth.go
generated
vendored
@@ -79,12 +79,14 @@ type OpenIDConnectResponse struct {
|
||||
SlackResponse
|
||||
}
|
||||
|
||||
// GetOAuthToken retrieves an AccessToken
|
||||
// GetOAuthToken retrieves an AccessToken.
|
||||
// For more details, see GetOAuthTokenContext documentation.
|
||||
func GetOAuthToken(client httpClient, clientID, clientSecret, code, redirectURI string) (accessToken string, scope string, err error) {
|
||||
return GetOAuthTokenContext(context.Background(), client, clientID, clientSecret, code, redirectURI)
|
||||
}
|
||||
|
||||
// GetOAuthTokenContext retrieves an AccessToken with a custom context
|
||||
// GetOAuthTokenContext retrieves an AccessToken with a custom context.
|
||||
// For more details, see GetOAuthResponseContext documentation.
|
||||
func GetOAuthTokenContext(ctx context.Context, client httpClient, clientID, clientSecret, code, redirectURI string) (accessToken string, scope string, err error) {
|
||||
response, err := GetOAuthResponseContext(ctx, client, clientID, clientSecret, code, redirectURI)
|
||||
if err != nil {
|
||||
@@ -94,11 +96,13 @@ func GetOAuthTokenContext(ctx context.Context, client httpClient, clientID, clie
|
||||
}
|
||||
|
||||
// GetBotOAuthToken retrieves top-level and bot AccessToken - https://api.slack.com/legacy/oauth#bot_user_access_tokens
|
||||
// For more details, see GetBotOAuthTokenContext documentation.
|
||||
func GetBotOAuthToken(client httpClient, clientID, clientSecret, code, redirectURI string) (accessToken string, scope string, bot OAuthResponseBot, err error) {
|
||||
return GetBotOAuthTokenContext(context.Background(), client, clientID, clientSecret, code, redirectURI)
|
||||
}
|
||||
|
||||
// GetBotOAuthTokenContext retrieves top-level and bot AccessToken with a custom context
|
||||
// GetBotOAuthTokenContext retrieves top-level and bot AccessToken with a custom context.
|
||||
// For more details, see GetOAuthResponseContext documentation.
|
||||
func GetBotOAuthTokenContext(ctx context.Context, client httpClient, clientID, clientSecret, code, redirectURI string) (accessToken string, scope string, bot OAuthResponseBot, err error) {
|
||||
response, err := GetOAuthResponseContext(ctx, client, clientID, clientSecret, code, redirectURI)
|
||||
if err != nil {
|
||||
@@ -107,12 +111,14 @@ func GetBotOAuthTokenContext(ctx context.Context, client httpClient, clientID, c
|
||||
return response.AccessToken, response.Scope, response.Bot, nil
|
||||
}
|
||||
|
||||
// GetOAuthResponse retrieves OAuth response
|
||||
// GetOAuthResponse retrieves OAuth response.
|
||||
// For more details, see GetOAuthResponseContext documentation.
|
||||
func GetOAuthResponse(client httpClient, clientID, clientSecret, code, redirectURI string) (resp *OAuthResponse, err error) {
|
||||
return GetOAuthResponseContext(context.Background(), client, clientID, clientSecret, code, redirectURI)
|
||||
}
|
||||
|
||||
// GetOAuthResponseContext retrieves OAuth response with custom context
|
||||
// GetOAuthResponseContext retrieves OAuth response with custom context.
|
||||
// Slack API docs: https://api.slack.com/methods/oauth.access
|
||||
func GetOAuthResponseContext(ctx context.Context, client httpClient, clientID, clientSecret, code, redirectURI string) (resp *OAuthResponse, err error) {
|
||||
values := url.Values{
|
||||
"client_id": {clientID},
|
||||
@@ -127,12 +133,14 @@ func GetOAuthResponseContext(ctx context.Context, client httpClient, clientID, c
|
||||
return response, response.Err()
|
||||
}
|
||||
|
||||
// GetOAuthV2Response gets a V2 OAuth access token response - https://api.slack.com/methods/oauth.v2.access
|
||||
// GetOAuthV2Response gets a V2 OAuth access token response.
|
||||
// For more details, see GetOAuthV2ResponseContext documentation.
|
||||
func GetOAuthV2Response(client httpClient, clientID, clientSecret, code, redirectURI string) (resp *OAuthV2Response, err error) {
|
||||
return GetOAuthV2ResponseContext(context.Background(), client, clientID, clientSecret, code, redirectURI)
|
||||
}
|
||||
|
||||
// GetOAuthV2ResponseContext with a context, gets a V2 OAuth access token response
|
||||
// GetOAuthV2ResponseContext with a context, gets a V2 OAuth access token response.
|
||||
// Slack API docs: https://api.slack.com/methods/oauth.v2.access
|
||||
func GetOAuthV2ResponseContext(ctx context.Context, client httpClient, clientID, clientSecret, code, redirectURI string) (resp *OAuthV2Response, err error) {
|
||||
values := url.Values{
|
||||
"client_id": {clientID},
|
||||
@@ -147,12 +155,14 @@ func GetOAuthV2ResponseContext(ctx context.Context, client httpClient, clientID,
|
||||
return response, response.Err()
|
||||
}
|
||||
|
||||
// RefreshOAuthV2Token with a context, gets a V2 OAuth access token response
|
||||
// RefreshOAuthV2Token with a context, gets a V2 OAuth access token response.
|
||||
// For more details, see RefreshOAuthV2TokenContext documentation.
|
||||
func RefreshOAuthV2Token(client httpClient, clientID, clientSecret, refreshToken string) (resp *OAuthV2Response, err error) {
|
||||
return RefreshOAuthV2TokenContext(context.Background(), client, clientID, clientSecret, refreshToken)
|
||||
}
|
||||
|
||||
// RefreshOAuthV2TokenContext with a context, gets a V2 OAuth access token response
|
||||
// RefreshOAuthV2TokenContext with a context, gets a V2 OAuth access token response.
|
||||
// Slack API docs: https://api.slack.com/methods/oauth.v2.access
|
||||
func RefreshOAuthV2TokenContext(ctx context.Context, client httpClient, clientID, clientSecret, refreshToken string) (resp *OAuthV2Response, err error) {
|
||||
values := url.Values{
|
||||
"client_id": {clientID},
|
||||
@@ -168,12 +178,13 @@ func RefreshOAuthV2TokenContext(ctx context.Context, client httpClient, clientID
|
||||
}
|
||||
|
||||
// GetOpenIDConnectToken exchanges a temporary OAuth verifier code for an access token for Sign in with Slack.
|
||||
// see: https://api.slack.com/methods/openid.connect.token
|
||||
// For more details, see GetOpenIDConnectTokenContext documentation.
|
||||
func GetOpenIDConnectToken(client httpClient, clientID, clientSecret, code, redirectURI string) (resp *OpenIDConnectResponse, err error) {
|
||||
return GetOpenIDConnectTokenContext(context.Background(), client, clientID, clientSecret, code, redirectURI)
|
||||
}
|
||||
|
||||
// GetOpenIDConnectTokenContext with a context, gets an access token for Sign in with Slack.
|
||||
// Slack API docs: https://api.slack.com/methods/openid.connect.token
|
||||
func GetOpenIDConnectTokenContext(ctx context.Context, client httpClient, clientID, clientSecret, code, redirectURI string) (resp *OpenIDConnectResponse, err error) {
|
||||
values := url.Values{
|
||||
"client_id": {clientID},
|
||||
|
||||
Reference in New Issue
Block a user