Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(experimentalIdentityAndAuth): revert release of @smithy.api#httpBearerAuth #5272

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions clients/client-codecatalyst/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@
"@aws-sdk/middleware-host-header": "*",
"@aws-sdk/middleware-logger": "*",
"@aws-sdk/middleware-recursion-detection": "*",
"@aws-sdk/middleware-token": "*",
"@aws-sdk/middleware-user-agent": "*",
"@aws-sdk/region-config-resolver": "*",
"@aws-sdk/token-providers": "*",
"@aws-sdk/types": "*",
"@aws-sdk/util-endpoints": "*",
"@aws-sdk/util-user-agent-browser": "*",
"@aws-sdk/util-user-agent-node": "*",
"@smithy/config-resolver": "^2.0.18",
"@smithy/core": "^1.0.1",
"@smithy/fetch-http-handler": "^2.2.6",
"@smithy/hash-node": "^2.0.15",
"@smithy/invalid-dependency": "^2.0.13",
Expand All @@ -54,7 +53,6 @@
"@smithy/util-defaults-mode-browser": "^2.0.19",
"@smithy/util-defaults-mode-node": "^2.0.25",
"@smithy/util-endpoints": "^1.0.4",
"@smithy/util-middleware": "^2.0.6",
"@smithy/util-retry": "^2.0.6",
"@smithy/util-utf8": "^2.0.2",
"tslib": "^2.5.0"
Expand Down
39 changes: 6 additions & 33 deletions clients/client-codecatalyst/src/CodeCatalystClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,14 @@ import {
} from "@aws-sdk/middleware-host-header";
import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
import { getTokenPlugin, resolveTokenConfig, TokenInputConfig, TokenResolvedConfig } from "@aws-sdk/middleware-token";
import {
getUserAgentPlugin,
resolveUserAgentConfig,
UserAgentInputConfig,
UserAgentResolvedConfig,
} from "@aws-sdk/middleware-user-agent";
import { RegionInputConfig, RegionResolvedConfig, resolveRegionConfig } from "@smithy/config-resolver";
import {
DefaultIdentityProviderConfig,
getHttpAuthSchemeEndpointRuleSetPlugin,
getHttpSigningPlugin,
} from "@smithy/core";
import { getContentLengthPlugin } from "@smithy/middleware-content-length";
import { EndpointInputConfig, EndpointResolvedConfig, resolveEndpointConfig } from "@smithy/middleware-endpoint";
import { getRetryPlugin, resolveRetryConfig, RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry";
Expand Down Expand Up @@ -48,12 +44,6 @@ import {
UserAgent as __UserAgent,
} from "@smithy/types";

import {
defaultCodeCatalystHttpAuthSchemeParametersProvider,
HttpAuthSchemeInputConfig,
HttpAuthSchemeResolvedConfig,
resolveHttpAuthSchemeConfig,
} from "./auth/httpAuthSchemeProvider";
import { CreateAccessTokenCommandInput, CreateAccessTokenCommandOutput } from "./commands/CreateAccessTokenCommand";
import {
CreateDevEnvironmentCommandInput,
Expand Down Expand Up @@ -348,8 +338,8 @@ export type CodeCatalystClientConfigType = Partial<__SmithyConfiguration<__HttpH
EndpointInputConfig<EndpointParameters> &
RetryInputConfig &
HostHeaderInputConfig &
TokenInputConfig &
UserAgentInputConfig &
HttpAuthSchemeInputConfig &
ClientInputEndpointParameters;
/**
* @public
Expand All @@ -368,8 +358,8 @@ export type CodeCatalystClientResolvedConfigType = __SmithyResolvedConfiguration
EndpointResolvedConfig<EndpointParameters> &
RetryResolvedConfig &
HostHeaderResolvedConfig &
TokenResolvedConfig &
UserAgentResolvedConfig &
HttpAuthSchemeResolvedConfig &
ClientResolvedEndpointParameters;
/**
* @public
Expand Down Expand Up @@ -544,26 +534,15 @@ export class CodeCatalystClient extends __Client<
*/
readonly config: CodeCatalystClientResolvedConfig;

private getDefaultHttpAuthSchemeParametersProvider() {
return defaultCodeCatalystHttpAuthSchemeParametersProvider;
}

private getIdentityProviderConfigProvider() {
return async (config: CodeCatalystClientResolvedConfig) =>
new DefaultIdentityProviderConfig({
"smithy.api#httpBearerAuth": config.token,
});
}

constructor(...[configuration]: __CheckOptionalClientConfig<CodeCatalystClientConfig>) {
const _config_0 = __getRuntimeConfig(configuration || {});
const _config_1 = resolveClientEndpointParameters(_config_0);
const _config_2 = resolveRegionConfig(_config_1);
const _config_3 = resolveEndpointConfig(_config_2);
const _config_4 = resolveRetryConfig(_config_3);
const _config_5 = resolveHostHeaderConfig(_config_4);
const _config_6 = resolveUserAgentConfig(_config_5);
const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
const _config_6 = resolveTokenConfig(_config_5);
const _config_7 = resolveUserAgentConfig(_config_6);
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
super(_config_8);
this.config = _config_8;
Expand All @@ -572,14 +551,8 @@ export class CodeCatalystClient extends __Client<
this.middlewareStack.use(getHostHeaderPlugin(this.config));
this.middlewareStack.use(getLoggerPlugin(this.config));
this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
this.middlewareStack.use(getTokenPlugin(this.config));
this.middlewareStack.use(getUserAgentPlugin(this.config));
this.middlewareStack.use(
getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
identityProviderConfigProvider: this.getIdentityProviderConfigProvider(),
httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(),
})
);
this.middlewareStack.use(getHttpSigningPlugin(this.config));
}

/**
Expand Down

This file was deleted.

134 changes: 0 additions & 134 deletions clients/client-codecatalyst/src/auth/httpAuthSchemeProvider.ts

This file was deleted.

5 changes: 1 addition & 4 deletions clients/client-codecatalyst/src/extensionConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ import { AwsRegionExtensionConfiguration } from "@aws-sdk/types";
import { HttpHandlerExtensionConfiguration } from "@smithy/protocol-http";
import { DefaultExtensionConfiguration } from "@smithy/types";

import { HttpAuthExtensionConfiguration } from "./auth/httpAuthExtensionConfiguration";

/**
* @internal
*/
export interface CodeCatalystExtensionConfiguration
extends HttpHandlerExtensionConfiguration,
DefaultExtensionConfiguration,
AwsRegionExtensionConfiguration,
HttpAuthExtensionConfiguration {}
AwsRegionExtensionConfiguration {}
13 changes: 0 additions & 13 deletions clients/client-codecatalyst/src/runtimeConfig.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import packageInfo from "../package.json"; // eslint-disable-line
import { Sha256 } from "@aws-crypto/sha256-browser";
import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver";
import { HttpBearerAuthSigner } from "@smithy/core";
import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler";
import { IdentityProviderConfig } from "@smithy/types";
import { calculateBodyLength } from "@smithy/util-body-length-browser";
import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry";
import { CodeCatalystClientConfig } from "./CodeCatalystClient";
Expand All @@ -31,17 +29,6 @@ export const getRuntimeConfig = (config: CodeCatalystClientConfig) => {
defaultUserAgentProvider:
config?.defaultUserAgentProvider ??
defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
httpAuthSchemes: config?.httpAuthSchemes ?? [
{
schemeId: "smithy.api#httpBearerAuth",
identityProvider: (ipc: IdentityProviderConfig) =>
ipc.getIdentityProvider("smithy.api#httpBearerAuth") ||
(async () => {
throw new Error("`token` is missing");
}),
signer: new HttpBearerAuthSigner(),
},
],
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
requestHandler: config?.requestHandler ?? new RequestHandler(defaultConfigProvider),
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
Expand Down
Loading
Loading