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): reorganize package structure into NPM packages #1007

Closed
wants to merge 1 commit into from
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
5 changes: 5 additions & 0 deletions .changeset/big-panthers-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@smithy/experimental-identity-and-auth": patch
---

Reorganize package structure into NPM packages.
18 changes: 6 additions & 12 deletions packages/experimental-identity-and-auth/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
export * from "./HttpAuthScheme";
export * from "./HttpAuthSchemeProvider";
export * from "./HttpSigner";
export * from "./IdentityProviderConfig";
export * from "./SigV4Signer";
export * from "./apiKeyIdentity";
export * from "./endpointRuleSet";
export * from "./httpApiKeyAuth";
export * from "./httpBearerAuth";
export * from "./memoizeIdentityProvider";
export * from "./middleware-http-auth-scheme";
export * from "./middleware-http-signing";
export * from "./noAuth";
export * from "./tokenIdentity";
export * from "./signature-v4";
export * from "./types";
export * from "./util-endpoint-rule-set-auth";
export * from "./util-http-api-key-auth";
export * from "./util-http-bearer-auth";
export * from "./util-identity-and-auth";
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { endpointMiddlewareOptions } from "@smithy/middleware-endpoint";
import { HandlerExecutionContext, Pluggable, RelativeMiddlewareOptions, SerializeHandlerOptions } from "@smithy/types";

import { HttpAuthSchemeParameters } from "../HttpAuthSchemeProvider";
import { HttpAuthSchemeParameters } from "../types/auth/HttpAuthSchemeProvider";
import { httpAuthSchemeMiddleware, PreviouslyResolved } from "./httpAuthSchemeMiddleware";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { serializerMiddlewareOption } from "@smithy/middleware-serde";
import { HandlerExecutionContext, Pluggable, RelativeMiddlewareOptions, SerializeHandlerOptions } from "@smithy/types";

import { HttpAuthSchemeParameters } from "../HttpAuthSchemeProvider";
import { HttpAuthSchemeParameters } from "../types/auth/HttpAuthSchemeProvider";
import { httpAuthSchemeMiddleware, PreviouslyResolved } from "./httpAuthSchemeMiddleware";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import {
} from "@smithy/types";
import { getSmithyContext } from "@smithy/util-middleware";

import { HttpAuthScheme, HttpAuthSchemeId, SelectedHttpAuthScheme } from "../HttpAuthScheme";
import { HttpAuthScheme, HttpAuthSchemeId, SelectedHttpAuthScheme } from "../types/auth/HttpAuthScheme";
import {
HttpAuthSchemeParameters,
HttpAuthSchemeParametersProvider,
HttpAuthSchemeProvider,
} from "../HttpAuthSchemeProvider";
import { IdentityProviderConfig } from "../IdentityProviderConfig";
} from "../types/auth/HttpAuthSchemeProvider";
import { IdentityProviderConfig } from "../types/identity/IdentityProviderConfig";

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from "@smithy/types";
import { getSmithyContext } from "@smithy/util-middleware";

import { SelectedHttpAuthScheme } from "../HttpAuthScheme";
import { SelectedHttpAuthScheme } from "../types/auth/HttpAuthScheme";

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { HttpRequest } from "@smithy/protocol-http";
import { SignatureV4 } from "@smithy/signature-v4";
import { AwsCredentialIdentity, HttpRequest as IHttpRequest } from "@smithy/types";

import { HttpSigner } from "./HttpSigner";
import { HttpSigner } from "../types/auth/HttpSigner";

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./SigV4Signer";
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Identity, IdentityProvider } from "@smithy/types";

import { IdentityProviderConfig } from "../identity/IdentityProviderConfig";
import { HttpSigner } from "./HttpSigner";
import { IdentityProviderConfig } from "./IdentityProviderConfig";

/**
* ID for {@link HttpAuthScheme}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from "./HttpAuthScheme";
export * from "./HttpAuthSchemeProvider";
export * from "./HttpSigner";
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Identity, IdentityProvider } from "@smithy/types";

import { HttpAuthSchemeId } from "../auth/HttpAuthScheme";

/**
* Interface to get an IdentityProvider for a specified HttpAuthScheme
* @internal
*/
export interface IdentityProviderConfig {
/**
* Get the IdentityProvider for a specified HttpAuthScheme.
* @param schemeId schemeId of the HttpAuthScheme
* @returns IdentityProvider or undefined if HttpAuthScheme is not found
*/
getIdentityProvider(schemeId: HttpAuthSchemeId): IdentityProvider<Identity> | undefined;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from "./apiKeyIdentity";
export * from "./IdentityProviderConfig";
export * from "./tokenIdentity";
2 changes: 2 additions & 0 deletions packages/experimental-identity-and-auth/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./auth";
export * from "./identity";
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { EndpointParameterInstructions, resolveParams } from "@smithy/middleware
import { EndpointParameters, EndpointV2, HandlerExecutionContext, Logger } from "@smithy/types";
import { getSmithyContext } from "@smithy/util-middleware";

import { HttpAuthOption } from "./HttpAuthScheme";
import { HttpAuthOption } from "../types/auth/HttpAuthScheme";
import {
HttpAuthSchemeParameters,
HttpAuthSchemeParametersProvider,
HttpAuthSchemeProvider,
} from "./HttpAuthSchemeProvider";
} from "../types/auth/HttpAuthSchemeProvider";

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./endpointRuleSet";
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { HttpRequest } from "@smithy/protocol-http";
import { HttpRequest as IHttpRequest } from "@smithy/types";

import { ApiKeyIdentity } from "./apiKeyIdentity";
import { HttpSigner } from "./HttpSigner";
import { HttpSigner } from "../types/auth/HttpSigner";
import { ApiKeyIdentity } from "../types/identity/apiKeyIdentity";

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./httpApiKeyAuth";
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { HttpRequest } from "@smithy/protocol-http";
import { HttpRequest as IHttpRequest } from "@smithy/types";

import { HttpSigner } from "./HttpSigner";
import { TokenIdentity } from "./tokenIdentity";
import { HttpSigner } from "../types/auth/HttpSigner";
import { TokenIdentity } from "../types/identity/tokenIdentity";

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./httpBearerAuth";
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
import { Identity, IdentityProvider } from "@smithy/types";

import { HttpAuthSchemeId } from "./HttpAuthScheme";

/**
* Interface to get an IdentityProvider for a specified HttpAuthScheme
* @internal
*/
export interface IdentityProviderConfig {
/**
* Get the IdentityProvider for a specified HttpAuthScheme.
* @param schemeId schemeId of the HttpAuthScheme
* @returns IdentityProvider or undefined if HttpAuthScheme is not found
*/
getIdentityProvider(schemeId: HttpAuthSchemeId): IdentityProvider<Identity> | undefined;
}
import { HttpAuthSchemeId } from "../types/auth/HttpAuthScheme";
import { IdentityProviderConfig } from "../types/identity/IdentityProviderConfig";

/**
* Default implementation of IdentityProviderConfig
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from "./DefaultIdentityProviderConfig";
export * from "./memoizeIdentityProvider";
export * from "./noAuth";
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HttpRequest, Identity } from "@smithy/types";

import { HttpSigner } from "./HttpSigner";
import { HttpSigner } from "../types/auth/HttpSigner";

/**
* Signer for the synthetic @smithy.api#noAuth auth scheme.
Expand Down
Loading