Socket
Socket
Sign inDemoInstall

@n8n/client-oauth2

Package Overview
Dependencies
Maintainers
5
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@n8n/client-oauth2 - npm Package Compare versions

Comparing version 0.11.0 to 0.12.0

1

dist/ClientOAuth2.d.ts

@@ -20,2 +20,3 @@ /// <reference types="node" />

accessTokenUri: string;
authentication?: 'header' | 'body';
authorizationUri?: string;

@@ -22,0 +23,0 @@ redirectUri?: string;

4

dist/CredentialsFlow.d.ts

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

import type { ClientOAuth2, ClientOAuth2Options } from './ClientOAuth2';
import type { ClientOAuth2 } from './ClientOAuth2';
import type { ClientOAuth2Token } from './ClientOAuth2Token';

@@ -6,3 +6,3 @@ export declare class CredentialsFlow {

constructor(client: ClientOAuth2);
getToken(opts?: Partial<ClientOAuth2Options>): Promise<ClientOAuth2Token>;
getToken(): Promise<ClientOAuth2Token>;
}

@@ -10,6 +10,7 @@ "use strict";

}
async getToken(opts) {
async getToken() {
var _a;
const options = { ...this.client.options, ...opts };
const options = { ...this.client.options };
(0, utils_1.expects)(options, 'clientId', 'clientSecret', 'accessTokenUri');
const headers = { ...constants_1.DEFAULT_HEADERS };
const body = {

@@ -21,9 +22,15 @@ grant_type: 'client_credentials',

}
const clientId = options.clientId;
const clientSecret = options.clientSecret;
if (options.authentication === 'body') {
body.client_id = clientId;
body.client_secret = clientSecret;
}
else {
headers.Authorization = (0, utils_1.auth)(clientId, clientSecret);
}
const requestOptions = (0, utils_1.getRequestOptions)({
url: options.accessTokenUri,
method: 'POST',
headers: {
...constants_1.DEFAULT_HEADERS,
Authorization: (0, utils_1.auth)(options.clientId, options.clientSecret),
},
headers,
body,

@@ -30,0 +37,0 @@ }, options);

export { ClientOAuth2, ClientOAuth2Options, ClientOAuth2RequestObject } from './ClientOAuth2';
export { ClientOAuth2Token, ClientOAuth2TokenData } from './ClientOAuth2Token';
export type * from './types';
export type Headers = Record<string, string | string[]>;
export type OAuth2GrantType = 'pkce' | 'authorizationCode' | 'clientCredentials';
export interface OAuth2CredentialData {
clientId: string;
clientSecret?: string;
accessTokenUrl: string;
authentication?: 'header' | 'body';
authUrl?: string;
scope?: string;
authQueryParameters?: string;
grantType: OAuth2GrantType;
ignoreSSLIssues?: boolean;
oauthTokenData?: {
access_token: string;
refresh_token?: string;
};
}
{
"name": "@n8n/client-oauth2",
"version": "0.11.0",
"version": "0.12.0",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "module": "src/index.ts",

Sorry, the diff of this file is not supported yet

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