Skip to content

Commit

Permalink
Merge branch 'master' into add-contract-links
Browse files Browse the repository at this point in the history
  • Loading branch information
hanseltime committed Nov 26, 2023
2 parents 4be94bd + 98fd852 commit 88fe1a2
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 24 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ jobs:
steps:
- uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.9
os_build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
python: [ 3.7, 3.8, 3.9 ]
node: [ 14 ]
python: [ 3.8, 3.9 ]
node: [ 18 ]
env:
SAM_CLI_TELEMETRY: "0"
AWS_REGION: "us-east-1"
Expand All @@ -32,8 +32,8 @@ jobs:
- name: Update Homebrew and save docker version
if: runner.os == 'macOS'
run: |
brew update --preinstall
cat "$(brew --repository)/Library/Taps/homebrew/homebrew-core/Formula/docker.rb" > .github/brew-formulae
brew tap homebrew/core
cat "$(brew --repository)/Library/Taps/homebrew/homebrew-core/Formula/d/docker.rb" > .github/brew-formulae
- name: Configure Homebrew docker cache files
uses: actions/cache@v3
if: runner.os == 'macOS'
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
sam build --debug --build-dir ./build TypeFunction
sam build --debug --build-dir ./build TestEntrypoint
sam local invoke -t ./build/template.yaml --debug --event ./sam-tests/create.json --log-file ./sam.log TestEntrypoint
grep -q '"status":"SUCCESS"' sam.log
grep -q '"SUCCESS"' sam.log
- name: Gather Debug Logs
id: gather_logs
continue-on-error: true
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@amazon-web-services-cloudformation/cloudformation-cli-typescript-lib",
"version": "1.0.4",
"version": "1.0.5",
"description": "The CloudFormation Resource Provider Development Kit (RPDK) allows you to author your own resource providers that can be used by CloudFormation. This plugin library helps to provide runtime bindings for the execution of your providers by CloudFormation.",
"private": false,
"main": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion python/rpdk/typescript/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging

__version__ = "1.0.2"
__version__ = "1.0.3"

logging.getLogger(__name__).addHandler(logging.NullHandler())
1 change: 0 additions & 1 deletion python/rpdk/typescript/templates/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ class Resource extends BaseResource<ResourceModel> {
typeConfiguration: TypeConfigurationModel,
): Promise<ProgressEvent<ResourceModel, CallbackContext>> {
const model = new ResourceModel(request.desiredResourceState);
model
/**
* TODO: put code for getting the specific model from here from just your primary identifier
* Example:
Expand Down
1 change: 0 additions & 1 deletion src/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,6 @@ export abstract class BaseResource<
this.prepareCredentialsFilter(this.callerSession)
);
}
this.log('EVENT DATA\n', eventData);
progress = await this.invokeHandler(
this.callerSession,
request,
Expand Down
15 changes: 1 addition & 14 deletions tests/lib/resource.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ describe('when getting resource', () => {
});

test('entrypoint redacting credentials', async () => {
expect.assertions(13);
expect.assertions(5);
const spyPublishLogEvent = jest.spyOn<any, any>(
LogPublisher.prototype,
'publishLogEvent'
Expand Down Expand Up @@ -283,19 +283,6 @@ describe('when getting resource', () => {
expect(spyPrepareLogStream).toBeCalledTimes(1);
expect(spyPublishLogEvent).toHaveBeenCalled();
expect(mockPublishMessage).toHaveBeenCalled();
mockPublishMessage.mock.calls.forEach((value: any[]) => {
const message = value[0] as string;
if (message && message.startsWith('EVENT DATA')) {
expect(message).toMatch(/bearerToken: '<REDACTED>'/);
expect(message).toMatch(
/providerCredentials: {\s+accessKeyId: '<REDACTED>',\s+secretAccessKey: '<REDACTED>',\s+sessionToken: '<REDACTED>'\s+}/
);
expect(message).toMatch(
/callerCredentials: {\s+accessKeyId: '<REDACTED>',\s+secretAccessKey: '<REDACTED>',\s+sessionToken: '<REDACTED>'\s+}/
);
expect(message).toMatch(/stack\/sample-stack\/<REDACTED>/);
}
});
});

test('entrypoint with callback context', async () => {
Expand Down

0 comments on commit 88fe1a2

Please sign in to comment.