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

@octokit/oauth-app

Package Overview
Dependencies
Maintainers
2
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/oauth-app - npm Package Compare versions

Comparing version 3.3.4 to 3.3.5

56

dist-node/index.js

@@ -68,3 +68,3 @@ 'use strict';

const VERSION = "3.3.4";
const VERSION = "3.3.5";

@@ -91,2 +91,21 @@ function addEventHandler(state, eventName, eventHandler) {

async function emitEvent(state, context) {
const {
name,
action
} = context;
if (state.eventHandlers[`${name}.${action}`]) {
for (const eventHandler of state.eventHandlers[`${name}.${action}`]) {
await eventHandler(context);
}
}
if (state.eventHandlers[name]) {
for (const eventHandler of state.eventHandlers[name]) {
await eventHandler(context);
}
}
}
async function getUserOctokitWithState(state, options) {

@@ -96,7 +115,19 @@ return state.octokit.auth(_objectSpread2(_objectSpread2({

}, options), {}, {
factory(options) {
return new state.Octokit({
async factory(options) {
const octokit = new state.Octokit({
authStrategy: authOauthUser.createOAuthUserAuth,
auth: options
});
const authentication = await octokit.auth({
type: "get"
});
await emitEvent(state, {
name: "token",
action: "created",
token: authentication.token,
scopes: authentication.scopes,
authentication,
octokit
});
return octokit;
}

@@ -121,21 +152,2 @@

async function emitEvent(state, context) {
const {
name,
action
} = context;
if (state.eventHandlers[`${name}.${action}`]) {
for (const eventHandler of state.eventHandlers[`${name}.${action}`]) {
await eventHandler(context);
}
}
if (state.eventHandlers[name]) {
for (const eventHandler of state.eventHandlers[name]) {
await eventHandler(context);
}
}
}
async function createTokenWithState(state, options) {

@@ -142,0 +154,0 @@ const authentication = await state.octokit.auth(_objectSpread2({

import { createOAuthUserAuth, } from "@octokit/auth-oauth-user";
import { emitEvent } from "../emit-event";
export async function getUserOctokitWithState(state, options) {

@@ -6,9 +7,21 @@ return state.octokit.auth({

...options,
factory(options) {
return new state.Octokit({
async factory(options) {
const octokit = new state.Octokit({
authStrategy: createOAuthUserAuth,
auth: options,
});
const authentication = (await octokit.auth({
type: "get",
}));
await emitEvent(state, {
name: "token",
action: "created",
token: authentication.token,
scopes: authentication.scopes,
authentication,
octokit,
});
return octokit;
},
});
}

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

export const VERSION = "3.3.4";
export const VERSION = "3.3.5";

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

export declare const VERSION = "3.3.4";
export declare const VERSION = "3.3.5";
{
"name": "@octokit/oauth-app",
"description": "GitHub OAuth toolset for Node.js",
"version": "3.3.4",
"version": "3.3.5",
"license": "MIT",

@@ -21,3 +21,3 @@ "files": [

"@octokit/auth-oauth-app": "^4.0.0",
"@octokit/auth-oauth-user": "^1.2.3",
"@octokit/auth-oauth-user": "^1.3.0",
"@octokit/auth-unauthenticated": "^2.0.0",

@@ -24,0 +24,0 @@ "@octokit/core": "^3.3.2",

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