Skip to content

Commit

Permalink
fix: refresh dependencies and address import cycles (#244)
Browse files Browse the repository at this point in the history
This commit refreshes the project's dependencies to address
a high-sev vulnerability reported in the http-cache-semantics
package.

Also included in this commit are minor changes to several
.ts files in order to address eslint errors reported by the
"import/no-cycle" rule.  These errors started showing up because
the eslint-plugin-import package was also upgraded from
2.26.0 to 2.27.5 (the latest) as a result of refreshing
the dependencies.

Signed-off-by: Phil Adams <phil_adams@us.ibm.com>
  • Loading branch information
padamstx authored May 22, 2023
1 parent ccb1811 commit 72aa8d5
Show file tree
Hide file tree
Showing 16 changed files with 2,139 additions and 12,334 deletions.
4 changes: 2 additions & 2 deletions auth/authenticators/basic-authenticator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2019, 2022.
* (C) Copyright IBM Corp. 2019, 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
*/

import extend from 'extend';
import { computeBasicAuthHeader, validateInput } from '../utils';
import { computeBasicAuthHeader, validateInput } from '../utils/helpers';
import { Authenticator } from './authenticator';
import { AuthenticateOptions } from './authenticator-interface';

Expand Down
4 changes: 2 additions & 2 deletions auth/authenticators/bearer-token-authenticator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2019, 2022.
* (C) Copyright IBM Corp. 2019, 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
*/

import extend from 'extend';
import { validateInput } from '../utils';
import { validateInput } from '../utils/helpers';
import { Authenticator } from './authenticator';
import { AuthenticateOptions } from './authenticator-interface';

Expand Down
4 changes: 2 additions & 2 deletions auth/authenticators/cloud-pak-for-data-authenticator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2019, 2022.
* (C) Copyright IBM Corp. 2019, 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
*/

import { Authenticator } from './authenticator';
import { Cp4dTokenManager } from '../token-managers';
import { Cp4dTokenManager } from '../token-managers/cp4d-token-manager';
import { BaseOptions, TokenRequestBasedAuthenticator } from './token-request-based-authenticator';

/** Configuration options for CloudPakForData authentication. */
Expand Down
4 changes: 2 additions & 2 deletions auth/authenticators/container-authenticator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021, 2022 IBM Corp. All Rights Reserved.
* Copyright 2021, 202e IBM Corp. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
*/

import { Authenticator } from './authenticator';
import { ContainerTokenManager } from '../token-managers';
import { ContainerTokenManager } from '../token-managers/container-token-manager';
import { IamRequestOptions, IamRequestBasedAuthenticator } from './iam-request-based-authenticator';

/** Configuration options for IAM authentication. */
Expand Down
6 changes: 3 additions & 3 deletions auth/authenticators/iam-authenticator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2019, 2022.
* (C) Copyright IBM Corp. 2019, 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,8 +15,8 @@
*/

import { Authenticator } from './authenticator';
import { IamTokenManager } from '../token-managers';
import { validateInput } from '../utils';
import { IamTokenManager } from '../token-managers/iam-token-manager';
import { validateInput } from '../utils/helpers';
import { IamRequestOptions, IamRequestBasedAuthenticator } from './iam-request-based-authenticator';

/** Configuration options for IAM authentication. */
Expand Down
4 changes: 2 additions & 2 deletions auth/authenticators/iam-request-based-authenticator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2019, 2022.
* (C) Copyright IBM Corp. 2019, 202e.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { IamRequestBasedTokenManager } from '../token-managers';
import { IamRequestBasedTokenManager } from '../token-managers/iam-request-based-token-manager';
import { BaseOptions, TokenRequestBasedAuthenticator } from './token-request-based-authenticator';

/** Configuration options for IAM Request based authentication. */
Expand Down
4 changes: 2 additions & 2 deletions auth/authenticators/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2019, 2021.
* (C) Copyright IBM Corp. 2019, 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,7 +30,7 @@
* authentication type is implemented as an Authenticator for consumption by a service.
*
* classes:
* AuthenticatorInterface: Implement this class to provide custom authentication schemes to services.
* AuthenticatorInterface: Implement this interface to provide custom authentication schemes to services.
* Authenticator: Extend this class to provide custom authentication schemes to services.
* BasicAuthenticator: Authenticator for passing supplied basic authentication information to service endpoint.
* BearerTokenAuthenticator: Authenticator for passing supplied bearer token to service endpoint.
Expand Down
4 changes: 2 additions & 2 deletions auth/authenticators/token-request-based-authenticator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2019, 2022.
* (C) Copyright IBM Corp. 2019, 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,7 @@

import extend from 'extend';
import { OutgoingHttpHeaders } from 'http';
import { JwtTokenManager } from '../token-managers';
import { JwtTokenManager } from '../token-managers/jwt-token-manager';
import { Authenticator } from './authenticator';
import { AuthenticateOptions } from './authenticator-interface';

Expand Down
4 changes: 2 additions & 2 deletions auth/authenticators/vpc-instance-authenticator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2021, 2022.
* (C) Copyright IBM Corp. 2021, 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
*/

import { Authenticator } from './authenticator';
import { VpcInstanceTokenManager } from '../token-managers';
import { VpcInstanceTokenManager } from '../token-managers/vpc-instance-token-manager';
import { BaseOptions, TokenRequestBasedAuthenticator } from './token-request-based-authenticator';

/** Configuration options for VpcInstance authentication. */
Expand Down
3 changes: 2 additions & 1 deletion auth/token-managers/container-token-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
* limitations under the License.
*/

import { atLeastOne, readCrTokenFile } from '../utils';
import { atLeastOne } from '../utils/helpers';
import { readCrTokenFile } from '../utils/file-reading-helpers';
import { IamRequestBasedTokenManager, IamRequestOptions } from './iam-request-based-token-manager';

const DEFAULT_CR_TOKEN_FILEPATH1 = '/var/run/secrets/tokens/vault-token';
Expand Down
4 changes: 2 additions & 2 deletions auth/token-managers/cp4d-token-manager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2019, 2022.
* (C) Copyright IBM Corp. 2019, 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,7 @@
*/

import extend from 'extend';
import { validateInput } from '../utils';
import { validateInput } from '../utils/helpers';
import { JwtTokenManager, JwtTokenManagerOptions } from './jwt-token-manager';

/** Configuration options for CP4D token retrieval. */
Expand Down
4 changes: 2 additions & 2 deletions auth/token-managers/iam-request-based-token-manager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2019, 2022.
* (C) Copyright IBM Corp. 2019, 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,7 +17,7 @@
import extend from 'extend';
import { OutgoingHttpHeaders } from 'http';
import logger from '../../lib/logger';
import { computeBasicAuthHeader, onlyOne, removeSuffix } from '../utils';
import { computeBasicAuthHeader, onlyOne, removeSuffix } from '../utils/helpers';
import { JwtTokenManager, JwtTokenManagerOptions } from './jwt-token-manager';

const CLIENT_ID_SECRET_WARNING =
Expand Down
4 changes: 2 additions & 2 deletions auth/token-managers/iam-token-manager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* (C) Copyright IBM Corp. 2019, 2022.
* (C) Copyright IBM Corp. 2019, 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { validateInput } from '../utils';
import { validateInput } from '../utils/helpers';
import { IamRequestBasedTokenManager, IamRequestOptions } from './iam-request-based-token-manager';

/** Configuration options for IAM token retrieval. */
Expand Down
4 changes: 2 additions & 2 deletions auth/token-managers/token-manager.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-unused-vars, class-methods-use-this */

/**
* (C) Copyright IBM Corp. 2020, 2022.
* (C) Copyright IBM Corp. 2020, 2023.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,7 +20,7 @@ import { OutgoingHttpHeaders } from 'http';
import { stripTrailingSlash } from '../../lib/helper';
import logger from '../../lib/logger';
import { RequestWrapper } from '../../lib/request-wrapper';
import { getCurrentTime } from '../utils';
import { getCurrentTime } from '../utils/helpers';

/** Configuration options for token retrieval. */
export type TokenManagerOptions = {
Expand Down
2 changes: 1 addition & 1 deletion auth/token-managers/vpc-instance-token-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import logger from '../../lib/logger';
import { atMostOne } from '../utils';
import { atMostOne } from '../utils/helpers';
import { JwtTokenManager, JwtTokenManagerOptions } from './jwt-token-manager';

const DEFAULT_IMS_ENDPOINT = 'http://169.254.169.254';
Expand Down
Loading

0 comments on commit 72aa8d5

Please sign in to comment.