Skip to content

Commit

Permalink
refactor: renaming oauth config interface
Browse files Browse the repository at this point in the history
Signed-off-by: Pawel Psztyc <[email protected]>
  • Loading branch information
jarrodek committed Jun 23, 2022
1 parent 140c1bf commit 2071751
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@advanced-rest-client/oauth",
"description": "The OAuth library for the Advanced REST Client",
"version": "0.2.0",
"version": "0.2.1",
"license": "Apache-2.0",
"main": "index.js",
"module": "index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/OAuth2Authorization.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ProcessingOptions, OAuth2Authorization as OAuth2Config, TokenInfo } from './types';
import { ProcessingOptions, OAuth2Config, TokenInfo } from './types';

export declare const resolveFunction: unique symbol;
export declare const rejectFunction: unique symbol;
Expand Down
4 changes: 2 additions & 2 deletions src/Utils.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { OAuth2Authorization } from "./types";
import { OAuth2Config } from "./types";

/**
* Checks if the URL has valid scheme for OAuth flow.
Expand All @@ -17,7 +17,7 @@ import { OAuth2Authorization } from "./types";
* @param settings authorization settings
* @throws {Error} When settings are not valid
*/
export function sanityCheck(settings: OAuth2Authorization): void;
export function sanityCheck(settings: OAuth2Config): void;

/**
* Generates a random string of characters.
Expand Down
2 changes: 1 addition & 1 deletion src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ interface BaseOAuth2Authorization {
/**
* OAuth 2 configuration object used in Advanced REST Client and API Components.
*/
export interface OAuth2Authorization extends BaseOAuth2Authorization {
export interface OAuth2Config extends BaseOAuth2Authorization {
/**
* The grant type of the OAuth 2 flow.
*
Expand Down
6 changes: 3 additions & 3 deletions test/oauth2/oauth2-client-credentials.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import { OAuth2Authorization } from '../../src/OAuth2Authorization.js';

// responses are defined in the ./ServerMock.js

/** @typedef {import('../../src/types').OAuth2Authorization} OAuth2Settings */
/** @typedef {import('../../src/types').OAuth2Config} OAuth2Config */

describe('OAuth2', () => {
describe('client credentials grant', () => {
describe('Body delivery method', () => {
const baseConfig = /** @type OAuth2Settings */ (Object.freeze({
const baseConfig = /** @type OAuth2Config */ (Object.freeze({
grantType: 'client_credentials',
clientId: 'auth-code-cid',
clientSecret: 'cc-secret',
Expand Down Expand Up @@ -78,7 +78,7 @@ describe('OAuth2', () => {
});

describe('Headers delivery method', () => {
const baseConfig = /** @type OAuth2Settings */ (Object.freeze({
const baseConfig = /** @type OAuth2Config */ (Object.freeze({
grantType: 'client_credentials',
clientId: 'auth-code-cid',
clientSecret: 'cc-secret',
Expand Down

0 comments on commit 2071751

Please sign in to comment.