Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@octokit/auth-app

Package Overview
Dependencies
Maintainers
2
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/auth-app - npm Package Compare versions

Comparing version 2.11.0 to 3.0.0

18

dist-node/index.js

@@ -9,3 +9,2 @@ 'use strict';

var request = require('@octokit/request');
var deprecation = require('deprecation');
var universalGithubAppJwt = require('universal-github-app-jwt');

@@ -319,4 +318,3 @@ var LRU = _interopDefault(require('lru-cache'));

data: {
access_token: token,
scope
access_token: token
}

@@ -327,4 +325,3 @@ } = response;

tokenType: "oauth",
token,
scopes: scope.split(/,\s*/).filter(Boolean)
token
};

@@ -473,3 +470,3 @@ }

const VERSION = "2.11.0";
const VERSION = "3.0.0";

@@ -480,7 +477,2 @@ const createAppAuth = function createAppAuth(options) {

}, options.log);
if ("id" in options) {
log.warn(new deprecation.Deprecation('[@octokit/auth-app] "createAppAuth({ id })" is deprecated, use "createAppAuth({ appId })" instead'));
}
const state = Object.assign({

@@ -493,5 +485,3 @@ request: request.request.defaults({

cache: getCache()
}, options, {
appId: Number("appId" in options ? options.appId : options.id)
}, options.installationId ? {
}, options, options.installationId ? {
installationId: Number(options.installationId)

@@ -498,0 +488,0 @@ } : {}, {

@@ -26,3 +26,3 @@ import { RequestError } from "@octokit/request-error";

}
const { data: { access_token: token, scope }, } = response;
const { data: { access_token: token }, } = response;
return {

@@ -32,4 +32,3 @@ type: "token",

token,
scopes: scope.split(/,\s*/).filter(Boolean),
};
}
import { getUserAgent } from "universal-user-agent";
import { request } from "@octokit/request";
import { Deprecation } from "deprecation";
import { auth } from "./auth";

@@ -12,5 +11,2 @@ import { hook } from "./hook";

}, options.log);
if ("id" in options) {
log.warn(new Deprecation('[@octokit/auth-app] "createAppAuth({ id })" is deprecated, use "createAppAuth({ appId })" instead'));
}
const state = Object.assign({

@@ -23,5 +19,3 @@ request: request.defaults({

cache: getCache(),
}, options, {
appId: Number("appId" in options ? options.appId : options.id),
}, options.installationId
}, options, options.installationId
? { installationId: Number(options.installationId) }

@@ -28,0 +22,0 @@ : {}, {

@@ -1,1 +0,1 @@

export const VERSION = "2.11.0";
export const VERSION = "3.0.0";
import { AppAuthentication, State } from "./types";
export declare function getAppAuthentication({ appId, privateKey, timeDifference, }: State): Promise<AppAuthentication>;
export declare function getAppAuthentication({ appId, privateKey, timeDifference, }: State & {
timeDifference?: number;
}): Promise<AppAuthentication>;

@@ -1,2 +0,2 @@

import { RequestInterface, OAuthOptions, StrategyOptionsWithDefaults, OAuthAccesTokenAuthentication } from "./types";
export declare function getOAuthAuthentication(state: StrategyOptionsWithDefaults, options: OAuthOptions, customRequest?: RequestInterface): Promise<OAuthAccesTokenAuthentication>;
import { RequestInterface, OAuthOptions, State, OAuthAccesTokenAuthentication } from "./types";
export declare function getOAuthAuthentication(state: State, options: OAuthOptions, customRequest?: RequestInterface): Promise<OAuthAccesTokenAuthentication>;

@@ -56,3 +56,2 @@ import * as OctokitTypes from "@octokit/types";

token: ACCESS_TOKEN;
scopes: string[];
};

@@ -65,2 +64,3 @@ export declare type Authentication = AppAuthentication | InstallationAccessTokenAuthentication | OAuthAccesTokenAuthentication;

declare type CommonStrategyOptions = {
appId: number | string;
privateKey: string;

@@ -75,16 +75,6 @@ installationId?: number | string;

};
declare type DeprecatedStrategyOptions = OAuthStrategyOptions & CommonStrategyOptions & {
/**
* @deprecated id is deprecated, use appId instead
*/
id: number | string;
};
declare type CurrentStrategyOptions = OAuthStrategyOptions & CommonStrategyOptions & {
appId: number | string;
};
export declare type StrategyOptions = (DeprecatedStrategyOptions | CurrentStrategyOptions) & {
export declare type StrategyOptions = OAuthStrategyOptions & CommonStrategyOptions & {
[key: string]: unknown;
};
export declare type FactoryOptions = Required<Omit<CurrentStrategyOptions, keyof State>> & State;
export declare type StrategyOptionsWithDefaults = CurrentStrategyOptions & Required<Omit<CurrentStrategyOptions, keyof OAuthStrategyOptions | "installationId">>;
export declare type FactoryOptions = Required<Omit<StrategyOptions, keyof State>> & State;
export declare type Permissions = {

@@ -112,5 +102,5 @@ [name: string]: string;

};
export declare type State = StrategyOptionsWithDefaults & {
timeDifference: number;
};
export declare type State = Required<Omit<CommonStrategyOptions, "installationId">> & {
installationId?: number;
} & OAuthStrategyOptions;
export {};

@@ -1,1 +0,1 @@

export declare const VERSION = "2.11.0";
export declare const VERSION = "3.0.0";
import { getUserAgent } from 'universal-user-agent';
import { request } from '@octokit/request';
import { Deprecation } from 'deprecation';
import { githubAppJwt } from 'universal-github-app-jwt';

@@ -192,3 +191,3 @@ import LRU from 'lru-cache';

}
const { data: { access_token: token, scope }, } = response;
const { data: { access_token: token }, } = response;
return {

@@ -198,3 +197,2 @@ type: "token",

token,
scopes: scope.split(/,\s*/).filter(Boolean),
};

@@ -340,3 +338,3 @@ }

const VERSION = "2.11.0";
const VERSION = "3.0.0";

@@ -347,5 +345,2 @@ const createAppAuth = function createAppAuth(options) {

}, options.log);
if ("id" in options) {
log.warn(new Deprecation('[@octokit/auth-app] "createAppAuth({ id })" is deprecated, use "createAppAuth({ appId })" instead'));
}
const state = Object.assign({

@@ -358,5 +353,3 @@ request: request.defaults({

cache: getCache(),
}, options, {
appId: Number("appId" in options ? options.appId : options.id),
}, options.installationId
}, options, options.installationId
? { installationId: Number(options.installationId) }

@@ -363,0 +356,0 @@ : {}, {

{
"name": "@octokit/auth-app",
"description": "GitHub App authentication for JavaScript",
"version": "2.11.0",
"version": "3.0.0",
"license": "MIT",

@@ -6,0 +6,0 @@ "files": [

@@ -107,4 +107,3 @@ # auth-app.js

// tokenType: 'oauth',
// token: 'token123',
// scopes: []
// token: 'token123'
// }

@@ -648,13 +647,2 @@ ```

</tr>
<tr>
<th>
<code>scopes</code>
</th>
<th>
<code>array of strings</code>
</th>
<td>
array of scope names enabled for the token
</td>
</tr>
</tbody>

@@ -661,0 +649,0 @@ </table>

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc