@slack/oauth
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -156,2 +156,4 @@ /// <reference types="node" /> | ||
authVersion?: AuthVersion; | ||
/** A string value that can be held in the state parameter in the OAuth flow. */ | ||
metadata?: string; | ||
} | ||
@@ -158,0 +160,0 @@ /** |
@@ -69,3 +69,3 @@ "use strict"; | ||
function InstallProvider(_a) { | ||
var clientId = _a.clientId, clientSecret = _a.clientSecret, _b = _a.stateSecret, stateSecret = _b === void 0 ? undefined : _b, _c = _a.stateStore, stateStore = _c === void 0 ? undefined : _c, _d = _a.installationStore, installationStore = _d === void 0 ? new MemoryInstallationStore() : _d, _e = _a.authVersion, authVersion = _e === void 0 ? 'v2' : _e, _f = _a.logger, logger = _f === void 0 ? undefined : _f, _g = _a.logLevel, logLevel = _g === void 0 ? logger_1.LogLevel.INFO : _g, _h = _a.clientOptions, clientOptions = _h === void 0 ? {} : _h, _j = _a.authorizationUrl, authorizationUrl = _j === void 0 ? 'https://slack.com/oauth/v2/authorize' : _j; | ||
var clientId = _a.clientId, clientSecret = _a.clientSecret, _b = _a.stateSecret, stateSecret = _b === void 0 ? undefined : _b, _c = _a.stateStore, stateStore = _c === void 0 ? undefined : _c, _d = _a.installationStore, installationStore = _d === void 0 ? new MemoryInstallationStore() : _d, _e = _a.authVersion, authVersion = _e === void 0 ? 'v2' : _e, _f = _a.logger, logger = _f === void 0 ? undefined : _f, _g = _a.logLevel, logLevel = _g === void 0 ? undefined : _g, _h = _a.clientOptions, clientOptions = _h === void 0 ? {} : _h, _j = _a.authorizationUrl, authorizationUrl = _j === void 0 ? 'https://slack.com/oauth/v2/authorize' : _j; | ||
if (clientId === undefined || clientSecret === undefined) { | ||
@@ -82,3 +82,3 @@ throw new errors_1.InstallerInitializationError('You must provide a valid clientId and clientSecret'); | ||
else { | ||
this.logger = logger_1.getLogger('OAuth:InstallProvider', logLevel, logger); | ||
this.logger = logger_1.getLogger('OAuth:InstallProvider', logLevel !== null && logLevel !== void 0 ? logLevel : logger_1.LogLevel.INFO, logger); | ||
} | ||
@@ -108,3 +108,3 @@ // Setup stateStore | ||
} | ||
this.clientOptions = __assign({ logLevel: this.logger.getLevel() }, clientOptions); | ||
this.clientOptions = __assign({ logger: logger, logLevel: this.logger.getLevel() }, clientOptions); | ||
} | ||
@@ -352,2 +352,7 @@ /** | ||
} | ||
if (installOptions !== undefined && installOptions.metadata !== undefined) { | ||
// Pass the metadata in state parameter if exists. | ||
// Developers can use the value for additional/custom data associated with the installation. | ||
installation.metadata = installOptions.metadata; | ||
} | ||
if (!installation.isEnterpriseInstall) return [3 /*break*/, 14]; | ||
@@ -354,0 +359,0 @@ return [4 /*yield*/, this.installationStore.storeInstallation(installation, this.logger)]; |
{ | ||
"name": "@slack/oauth", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "Official library for interacting with Slack's Oauth endpoints", | ||
@@ -41,4 +41,4 @@ "author": "Slack Technologies, Inc.", | ||
"dependencies": { | ||
"@slack/logger": "^2.0.0", | ||
"@slack/web-api": "^5.7.0", | ||
"@slack/logger": "^3.0.0", | ||
"@slack/web-api": "^6.0.0", | ||
"@types/jsonwebtoken": "^8.3.7", | ||
@@ -45,0 +45,0 @@ "@types/node": ">=12", |
# Slack OAuth | ||
[![build-ci](https://github.com/slackapi/node-slack-sdk/workflows/CI%20Build/badge.svg)](https://github.com/slackapi/node-slack-sdk/actions?query=workflow%3A%22CI+Build%22) | ||
<!-- TODO: per-flag badge https://docs.codecov.io/docs/flags#section-flag-badges-and-graphs --> | ||
[![codecov](https://codecov.io/gh/slackapi/node-slack-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/slackapi/node-slack-sdk) | ||
<!-- TODO: npm versions with scoped packages: https://github.com/rvagg/nodei.co/issues/24 --> | ||
The `@slack/oauth` package makes it simple to setup the OAuth flow for Slack apps. It supports [V2 OAuth](https://api.slack.com/authentication/oauth-v2) for Slack Apps as well as [V1 OAuth](https://api.slack.com/docs/oauth) for [Classic Slack apps](https://api.slack.com/authentication/quickstart). Slack apps that are installed in multiple workspaces, like in the App Directory or in an Enterprise Grid, will need to implement OAuth and store information about each of those installations (such as access tokens). | ||
@@ -9,0 +4,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
82803
860
361
1
+ Added@slack/logger@3.0.0(transitive)
+ Added@slack/types@2.14.0(transitive)
+ Added@slack/web-api@6.13.0(transitive)
+ Addedaxios@1.7.8(transitive)
+ Addedform-data@4.0.1(transitive)
+ Addedis-electron@2.2.2(transitive)
+ Addedproxy-from-env@1.1.0(transitive)
- Removed@slack/logger@2.0.0(transitive)
- Removed@slack/types@1.10.0(transitive)
- Removed@slack/web-api@5.15.0(transitive)
- Removedaxios@0.21.4(transitive)
Updated@slack/logger@^3.0.0
Updated@slack/web-api@^6.0.0