Socket
Socket
Sign inDemoInstall

aws-crt

Package Overview
Dependencies
Maintainers
4
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-crt - npm Package Compare versions

Comparing version 1.14.4 to 1.14.5

125

dist/native/auth.d.ts

@@ -10,9 +10,99 @@ /**

import crt_native from './binding';
import { HttpRequest } from './http';
import { ClientBootstrap } from './io';
import { HttpRequest, HttpProxyOptions } from './http';
import { ClientBootstrap, ClientTlsContext } from './io';
/**
* @internal
* A pair defining an identity provider and a valid login token sourced from it.
*
* @category Auth
*/
declare type StringLike = string | ArrayBuffer | DataView;
export interface CognitoLoginTokenPair {
/**
* Name of an identity provider
*/
identityProviderName: string;
/**
* Valid login token source from the identity provider
*/
identityProviderToken: string;
}
/**
* Definition for the configuration needed to create a Cognito-based Credentials Provider
*
* @category Auth
*/
export interface CognitoCredentialsProviderConfig {
/**
* Cognito service regional endpoint to source credentials from.
*/
endpoint: string;
/**
* Cognito identity to fetch credentials relative to.
*/
identity: string;
/**
* Optional set of identity provider token pairs to allow for authenticated identity access.
*/
logins?: Array<CognitoLoginTokenPair>;
/**
* Optional ARN of the role to be assumed when multiple roles were received in the token from the identity provider.
*/
customRoleArn?: string;
/**
* TLS context for secure socket connections.
* If undefined, then a default tls context will be created and used.
*/
tlsContext?: ClientTlsContext;
/**
* Client bootstrap to use. In almost all cases, this can be left undefined.
*/
bootstrap?: ClientBootstrap;
/**
* Proxy configuration if connecting through an HTTP proxy is desired
*/
httpProxyOptions?: HttpProxyOptions;
}
/**
* Credentials providers source the AwsCredentials needed to sign an authenticated AWS request.
*
* We don't currently expose an interface for fetching credentials from Javascript.
*
* @category Auth
*/
export declare class AwsCredentialsProvider extends crt_native.AwsCredentialsProvider {
/**
* Creates a new default credentials provider to be used internally for AWS credentials resolution:
*
* The CRT's default provider chain currently sources in this order:
*
* 1. Environment
* 2. Profile
* 3. (conditional, off by default) ECS
* 4. (conditional, on by default) EC2 Instance Metadata
*
* @param bootstrap (optional) client bootstrap to be used to establish any required network connections
*
* @returns a new credentials provider using default credentials resolution rules
*/
static newDefault(bootstrap?: ClientBootstrap | undefined): AwsCredentialsProvider;
/**
* Creates a new credentials provider that returns a fixed set of credentials.
*
* @param access_key access key to use in the static credentials
* @param secret_key secret key to use in the static credentials
* @param session_token (optional) session token to use in the static credentials
*
* @returns a new credentials provider that will return a fixed set of AWS credentials
*/
static newStatic(access_key: crt_native.StringLike, secret_key: crt_native.StringLike, session_token?: crt_native.StringLike): AwsCredentialsProvider;
/**
* Creates a new credentials provider that sources credentials from the AWS Cognito Identity service via the
* GetCredentialsForIdentity http API.
*
* @param config provider configuration necessary to make GetCredentialsForIdentity web requests
*
* @returns a new credentials provider that returns credentials sourced from the AWS Cognito Identity service
*/
static newCognito(config: CognitoCredentialsProviderConfig): AwsCredentialsProvider;
}
/**
* AWS signing algorithm enumeration.

@@ -73,26 +163,2 @@ *

/**
* Credentials providers source the AwsCredentials needed to sign an authenticated AWS request.
*
* We don't currently expose an interface for fetching credentials from Javascript.
*
* @category Auth
*/
export declare class AwsCredentialsProvider extends crt_native.AwsCredentialsProvider {
/**
* Creates a new default credentials provider to be used internally for AWS credentials resolution:
*
* The CRT's default provider chain currently sources in this order:
*
* 1. Environment
* 2. Profile
* 3. (conditional, off by default) ECS
* 4. (conditional, on by default) EC2 Instance Metadata
*
* @param bootstrap (optional) client bootstrap to be used to establish any required network connections
*
* @returns a new credentials provider using default credentials resolution rules
*/
static newDefault(bootstrap?: ClientBootstrap | undefined): AwsCredentialsProvider;
}
/**
* Configuration for use in AWS-related signing.

@@ -199,3 +265,2 @@ * AwsSigningConfig is immutable.

*/
export declare function aws_verify_sigv4a_signing(request: HttpRequest, config: AwsSigningConfig, expected_canonical_request: StringLike, signature: StringLike, ecc_key_pub_x: StringLike, ecc_key_pub_y: StringLike): boolean;
export {};
export declare function aws_verify_sigv4a_signing(request: HttpRequest, config: AwsSigningConfig, expected_canonical_request: crt_native.StringLike, signature: crt_native.StringLike, ecc_key_pub_x: crt_native.StringLike, ecc_key_pub_y: crt_native.StringLike): boolean;

@@ -19,6 +19,58 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.aws_verify_sigv4a_signing = exports.aws_sign_request = exports.AwsCredentialsProvider = exports.AwsSignedBodyHeaderType = exports.AwsSignedBodyValue = exports.AwsSignatureType = exports.AwsSigningAlgorithm = void 0;
exports.aws_verify_sigv4a_signing = exports.aws_sign_request = exports.AwsSignedBodyHeaderType = exports.AwsSignedBodyValue = exports.AwsSignatureType = exports.AwsSigningAlgorithm = exports.AwsCredentialsProvider = void 0;
const binding_1 = __importDefault(require("./binding"));
const error_1 = require("./error");
const io_1 = require("./io");
/**
* Credentials providers source the AwsCredentials needed to sign an authenticated AWS request.
*
* We don't currently expose an interface for fetching credentials from Javascript.
*
* @category Auth
*/
/* Subclass for the purpose of exposing a non-NativeHandle based API */
class AwsCredentialsProvider extends binding_1.default.AwsCredentialsProvider {
/**
* Creates a new default credentials provider to be used internally for AWS credentials resolution:
*
* The CRT's default provider chain currently sources in this order:
*
* 1. Environment
* 2. Profile
* 3. (conditional, off by default) ECS
* 4. (conditional, on by default) EC2 Instance Metadata
*
* @param bootstrap (optional) client bootstrap to be used to establish any required network connections
*
* @returns a new credentials provider using default credentials resolution rules
*/
static newDefault(bootstrap = undefined) {
return super.newDefault(bootstrap != null ? bootstrap.native_handle() : null);
}
/**
* Creates a new credentials provider that returns a fixed set of credentials.
*
* @param access_key access key to use in the static credentials
* @param secret_key secret key to use in the static credentials
* @param session_token (optional) session token to use in the static credentials
*
* @returns a new credentials provider that will return a fixed set of AWS credentials
*/
static newStatic(access_key, secret_key, session_token) {
return super.newStatic(access_key, secret_key, session_token);
}
/**
* Creates a new credentials provider that sources credentials from the AWS Cognito Identity service via the
* GetCredentialsForIdentity http API.
*
* @param config provider configuration necessary to make GetCredentialsForIdentity web requests
*
* @returns a new credentials provider that returns credentials sourced from the AWS Cognito Identity service
*/
static newCognito(config) {
return super.newCognito(config, config.tlsContext != null ? config.tlsContext.native_handle() : new io_1.ClientTlsContext().native_handle(), config.bootstrap != null ? config.bootstrap.native_handle() : null, config.httpProxyOptions ? config.httpProxyOptions.create_native_handle() : null);
}
}
exports.AwsCredentialsProvider = AwsCredentialsProvider;
/**
* AWS signing algorithm enumeration.

@@ -83,30 +135,2 @@ *

/**
* Credentials providers source the AwsCredentials needed to sign an authenticated AWS request.
*
* We don't currently expose an interface for fetching credentials from Javascript.
*
* @category Auth
*/
/* Subclass for the purpose of exposing a non-NativeHandle based API */
class AwsCredentialsProvider extends binding_1.default.AwsCredentialsProvider {
/**
* Creates a new default credentials provider to be used internally for AWS credentials resolution:
*
* The CRT's default provider chain currently sources in this order:
*
* 1. Environment
* 2. Profile
* 3. (conditional, off by default) ECS
* 4. (conditional, on by default) EC2 Instance Metadata
*
* @param bootstrap (optional) client bootstrap to be used to establish any required network connections
*
* @returns a new credentials provider using default credentials resolution rules
*/
static newDefault(bootstrap = undefined) {
return super.newDefault(bootstrap != null ? bootstrap.native_handle() : null);
}
}
exports.AwsCredentialsProvider = AwsCredentialsProvider;
/**
* Perform AWS HTTP request signing.

@@ -113,0 +137,0 @@ *

@@ -6,12 +6,11 @@ /*

// The only exported types are http-related. If this changes, we'll need to rework the pseudo-module configuration
// for documentation
/**
* This module is internal-only and not exported.
*
* @packageDocumentation
* @module http
* @module binding
*/
import { InputStream, TlsContextOptions } from "./io";
import { AwsSigningConfig } from "./auth";
import {AwsSigningConfig, CognitoCredentialsProviderConfig} from "./auth";
import { HttpHeader, HttpHeaders as CommonHttpHeaders } from "../common/http";

@@ -26,3 +25,6 @@ import { OnMessageCallback, QoS } from "../common/mqtt";

type StringLike = string | ArrayBuffer | ArrayBufferView;
/**
* Polymorphic union of types that we convert to byte sequences in native.
*/
export type StringLike = string | ArrayBuffer | ArrayBufferView;

@@ -384,2 +386,3 @@ /* common */

static newStatic(access_key: StringLike, secret_key: StringLike, session_token?: StringLike): AwsCredentialsProvider;
static newCognito(config: CognitoCredentialsProviderConfig, tlsContext : NativeHandle, bootstrap?: NativeHandle, httpProxyOptions?: NativeHandle): AwsCredentialsProvider;
}

@@ -386,0 +389,0 @@

{
"name": "aws-crt",
"version": "1.14.4",
"version": "1.14.5",
"description": "NodeJS/browser bindings to the aws-c-* libraries",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/awslabs/aws-crt-nodejs",

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

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

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