Skip to content

Commit b9074ad

Browse files
Added custom authorizer sample (#246)
Adds custom authorizer support and samples! Commit log: * Added custom authorizer sample * Renamed codebuild to proper name * Added custom authorizer connect sample for the browser * Added custom authorizer documentation to the README * Added missing header links to the samples in the README * Fixed README headers not being correct for custom authorizer sample * Updated to use latest CRT release * Rebuilt using an older version of node so the package-lock version is correct * Regenerated package-lock.json with clean node run
1 parent b9cb6f0 commit b9074ad

File tree

15 files changed

+639
-394
lines changed

15 files changed

+639
-394
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
env
6+
7+
pushd $CODEBUILD_SRC_DIR/samples/node/custom_authorizer_connect
8+
9+
ENDPOINT=$(aws secretsmanager get-secret-value --secret-id "unit-test/endpoint" --query "SecretString" | cut -f2 -d":" | sed -e 's/[\\\"\}]//g')
10+
AUTH_NAME=$(aws secretsmanager get-secret-value --secret-id "unit-test/authorizer-name" --query "SecretString" | cut -f2 -d":" | sed -e 's/[\\\"\}]//g')
11+
AUTH_PASSWORD=$(aws secretsmanager get-secret-value --secret-id "unit-test/authorizer-password" --query "SecretString" | cut -f2 -d":" | sed -e 's/[\\\"\}]//g')
12+
13+
npm install --unsafe-perm
14+
15+
echo "Custom Authorizer Connect test"
16+
node dist/index.js --endpoint $ENDPOINT --custom_auth_authorizer_name $AUTH_NAME --custom_auth_password $AUTH_PASSWORD
17+
18+
popd

codebuild/samples/linux-smoke-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ phases:
99
- echo Build started on `date`
1010
- $CODEBUILD_SRC_DIR/codebuild/samples/setup-linux.sh
1111
- $CODEBUILD_SRC_DIR/codebuild/samples/connect-linux.sh
12+
- $CODEBUILD_SRC_DIR/codebuild/samples/connect-custom-authorizer-linux.sh
1213
post_build:
1314
commands:
1415
- echo Build completed on `date`

lib/browser.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0.
4+
*/
5+
6+
/**
7+
* Browser entry point for AWS IoT SDK.
8+
* @packageDocumentation
9+
* @module aws-iot-device-sdk
10+
* @preferred
11+
*/
12+
13+
import { mqtt, http, io, iot } from 'aws-crt/dist.browser/browser';
14+
15+
export {
16+
mqtt,
17+
http,
18+
io,
19+
iot
20+
}

0 commit comments

Comments
 (0)