Socket
Socket
Sign inDemoInstall

@octokit/auth-oauth-app

Package Overview
Dependencies
Maintainers
3
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/auth-oauth-app - npm Package Compare versions

Comparing version 2.0.4 to 2.1.0

6

dist-node/index.js

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

function requiresBasicAuth(url) {
return OAUTH_ROUTES_EXCEPTIONS_REGEX.test(url);
return url && OAUTH_ROUTES_EXCEPTIONS_REGEX.test(url);
}

@@ -94,3 +94,3 @@

if (/:client_id/.test(endpoint.url)) {
if (endpoint.url && /:client_id/.test(endpoint.url)) {
endpoint = Object.assign({

@@ -115,3 +115,3 @@ client_id: state.clientId,

const VERSION = "2.0.4";
const VERSION = "2.1.0";

@@ -118,0 +118,0 @@ function createOAuthAppAuth(options) {

@@ -14,3 +14,3 @@ import btoa from "btoa-lite";

// default `:client_id` & `:access_token` URL parameters
if (/:client_id/.test(endpoint.url)) {
if (endpoint.url && /:client_id/.test(endpoint.url)) {
endpoint = Object.assign({

@@ -17,0 +17,0 @@ client_id: state.clientId,

@@ -10,3 +10,3 @@ /**

export function requiresBasicAuth(url) {
return OAUTH_ROUTES_EXCEPTIONS_REGEX.test(url);
return url && OAUTH_ROUTES_EXCEPTIONS_REGEX.test(url);
}

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

export const VERSION = "2.0.4";
export const VERSION = "2.1.0";

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

import { Request, State, TokenWithScopes } from "./types";
export declare function getOAuthAccessToken(state: State, customRequest?: Request): Promise<TokenWithScopes>;
import { RequestInterface, State, TokenWithScopes } from "./types";
export declare function getOAuthAccessToken(state: State, customRequest?: RequestInterface): Promise<TokenWithScopes>;

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

import { AnyResponse, Endpoint, Parameters, Request, Route, State } from "./types";
export declare function hook(state: State, request: Request, route: Route | Endpoint, parameters?: Parameters): Promise<AnyResponse>;
import { AnyResponse, EndpointOptions, RequestParameters, RequestInterface, Route, State } from "./types";
export declare function hook(state: State, request: RequestInterface, route: Route | EndpointOptions, parameters?: RequestParameters): Promise<AnyResponse>;

@@ -31,3 +31,3 @@ import { StrategyOptions } from "./types";

}>) & {
hook: (request: import("@octokit/request/dist-types/types").request, route: string | import("./types").Endpoint, parameters?: import("./types").Parameters | undefined) => Promise<import("./types").OctokitResponse<any>>;
hook: (request: import("@octokit/types").RequestInterface, route: string | import("@octokit/types").EndpointOptions, parameters?: import("@octokit/types").RequestParameters | undefined) => Promise<import("@octokit/types").OctokitResponse<any>>;
};

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

export declare function requiresBasicAuth(url: string): boolean;
export declare function requiresBasicAuth(url: string | undefined): boolean | "" | undefined;

@@ -1,3 +0,8 @@

/// <reference types="node" />
import { request } from "@octokit/request";
import * as OctokitTypes from "@octokit/types";
export declare type AnyResponse = OctokitTypes.OctokitResponse<any>;
export declare type EndpointDefaults = OctokitTypes.EndpointDefaults;
export declare type EndpointOptions = OctokitTypes.EndpointOptions;
export declare type RequestParameters = OctokitTypes.RequestParameters;
export declare type Route = OctokitTypes.Route;
export declare type RequestInterface = OctokitTypes.RequestInterface;
export declare type StrategyOptions = {

@@ -9,3 +14,3 @@ clientId: string;

state?: string;
request?: typeof request;
request?: RequestInterface;
};

@@ -24,120 +29,5 @@ declare type AuthAppOptions = {

export declare type State = StrategyOptions & {
request: typeof request;
request: RequestInterface;
token?: TokenWithScopes;
};
export declare type Request = typeof request;
import { Agent } from "http";
export declare type Fetch = any;
export declare type Signal = any;
export declare type Endpoint = Parameters & {
method: Method;
url: Url;
};
export declare type Method = "DELETE" | "GET" | "HEAD" | "PATCH" | "POST" | "PUT";
export declare type Route = string;
export declare type Url = string;
export declare type Parameters = {
/**
* Base URL to be used when a relative URL is passed, such as `/orgs/:org`.
* If `baseUrl` is `https://enterprise.acme-inc.com/api/v3`, then the request
* will be sent to `https://enterprise.acme-inc.com/api/v3/orgs/:org`.
*/
baseUrl?: string;
/**
* HTTP headers. Use lowercase keys.
*/
headers?: RequestHeaders;
/**
* Media type options, see {@link https://developer.github.com/v3/media/|GitHub Developer Guide}
*/
mediaType?: {
/**
* `json` by default. Can be `raw`, `text`, `html`, `full`, `diff`, `patch`, `sha`, `base64`. Depending on endpoint
*/
format?: string;
/**
* Custom media type names of {@link https://developer.github.com/v3/media/|API Previews} without the `-preview` suffix.
* Example for single preview: `['squirrel-girl']`.
* Example for multiple previews: `['squirrel-girl', 'mister-fantastic']`.
*/
previews?: string[];
};
/**
* Pass custom meta information for the request. The `request` object will be returned as is.
*/
request?: OctokitRequestOptions;
/**
* Any additional parameter will be passed as follows
* 1. URL parameter if `':parameter'` or `{parameter}` is part of `url`
* 2. Query parameter if `method` is `'GET'` or `'HEAD'`
* 3. Request body if `parameter` is `'data'`
* 4. JSON in the request body in the form of `body[parameter]` unless `parameter` key is `'data'`
*/
[parameter: string]: any;
};
export declare type OctokitRequestOptions = {
/**
* Node only. Useful for custom proxy, certificate, or dns lookup.
*/
agent?: Agent;
/**
* Custom replacement for built-in fetch method. Useful for testing or request hooks.
*/
fetch?: Fetch;
/**
* Use an `AbortController` instance to cancel a request. In node you can only cancel streamed requests.
*/
signal?: Signal;
/**
* Node only. Request/response timeout in ms, it resets on redirect. 0 to disable (OS limit applies). `options.request.signal` is recommended instead.
*/
timeout?: number;
[option: string]: any;
};
export declare type RequestHeaders = {
/**
* Avoid setting `accept`, use `mediaFormat.{format|previews}` instead.
*/
accept?: string;
/**
* Use `authorization` to send authenticated request, remember `token ` / `bearer ` prefixes. Example: `token 1234567890abcdef1234567890abcdef12345678`
*/
authorization?: string;
/**
* `user-agent` is set do a default and can be overwritten as needed.
*/
"user-agent"?: string;
[header: string]: string | number | undefined;
};
export declare type ResponseHeaders = {
[header: string]: string;
};
export declare type OctokitResponse<T> = {
headers: ResponseHeaders;
/**
* http response code
*/
status: number;
/**
* URL of response after all redirects
*/
url: string;
/**
* This is the data you would see in https://developer.Octokit.com/v3/
*/
data: T;
};
export declare type AnyResponse = OctokitResponse<any>;
export declare type Defaults = Parameters & {
method: Method;
baseUrl: string;
headers: RequestHeaders & {
accept: string;
"user-agent": string;
};
mediaType: {
format: string;
previews: string[];
};
};
export {};

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

export declare const VERSION = "2.0.4";
export declare const VERSION = "2.1.0";

@@ -40,3 +40,3 @@ import { getUserAgent } from 'universal-user-agent';

function requiresBasicAuth(url) {
return OAUTH_ROUTES_EXCEPTIONS_REGEX.test(url);
return url && OAUTH_ROUTES_EXCEPTIONS_REGEX.test(url);
}

@@ -87,3 +87,3 @@

// default `:client_id` & `:access_token` URL parameters
if (/:client_id/.test(endpoint.url)) {
if (endpoint.url && /:client_id/.test(endpoint.url)) {
endpoint = Object.assign({

@@ -106,3 +106,3 @@ client_id: state.clientId,

const VERSION = "2.0.4";
const VERSION = "2.1.0";

@@ -109,0 +109,0 @@ function createOAuthAppAuth(options) {

{
"name": "@octokit/auth-oauth-app",
"description": "GitHub OAuth App authentication for JavaScript",
"version": "2.0.4",
"version": "2.1.0",
"license": "MIT",

@@ -25,3 +25,4 @@ "files": [

"dependencies": {
"@octokit/request": "^5.0.2",
"@octokit/request": "^5.3.0",
"@octokit/types": "^1.0.0",
"@types/btoa-lite": "^1.0.0",

@@ -33,5 +34,5 @@ "btoa-lite": "^1.0.0",

"@pika/pack": "^0.5.0",
"@pika/plugin-build-node": "^0.6.0",
"@pika/plugin-build-web": "^0.6.0",
"@pika/plugin-ts-standard-pkg": "^0.6.0",
"@pika/plugin-build-node": "^0.7.0",
"@pika/plugin-build-web": "^0.7.0",
"@pika/plugin-ts-standard-pkg": "^0.7.0",
"@types/fetch-mock": "^7.3.1",

@@ -52,3 +53,3 @@ "@types/jest": "^24.0.13",

"main": "dist-node/index.js",
"module": "dist-web/index.js"
"deno": "dist-web/index.js"
}

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