-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
1,251 additions
and
1,186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import { awscdk } from 'projen'; | ||
import { awscdk } from "projen"; | ||
|
||
const project = new awscdk.AwsCdkConstructLibrary({ | ||
author: 'Ben Limmer', | ||
authorAddress: '[email protected]', | ||
cdkVersion: '2.1.0', | ||
defaultReleaseBranch: 'main', | ||
name: '@blimmer/cdk-circleci-oidc', | ||
repositoryUrl: 'https://github.com/blimmer/cdk-circleci-oidc.git', | ||
author: "Ben Limmer", | ||
authorAddress: "[email protected]", | ||
cdkVersion: "2.1.0", | ||
defaultReleaseBranch: "main", | ||
name: "@blimmer/cdk-circleci-oidc", | ||
repositoryUrl: "https://github.com/blimmer/cdk-circleci-oidc.git", | ||
|
||
projenrcTs: true, | ||
|
||
jsiiVersion: "~5.0.0", | ||
|
||
python: { | ||
distName: 'cdk-circleci-oidc', | ||
module: 'cdk_circleci_oidc', | ||
distName: "cdk-circleci-oidc", | ||
module: "cdk_circleci_oidc", | ||
}, | ||
|
||
depsUpgrade: false, | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export * from './CircleCiOidcProvider'; | ||
export * from './CircleCiOidcRole'; | ||
export * from "./CircleCiOidcProvider"; | ||
export * from "./CircleCiOidcRole"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,47 @@ | ||
import { App, Stack } from 'aws-cdk-lib'; | ||
import { Template } from 'aws-cdk-lib/assertions'; | ||
import { CircleCiOidcProvider } from '../src'; | ||
import { App, Stack } from "aws-cdk-lib"; | ||
import { Template } from "aws-cdk-lib/assertions"; | ||
import { CircleCiOidcProvider } from "../src"; | ||
|
||
describe('CircleCiOidcProvider', () => { | ||
it('uses the organization ID as the client ID', () => { | ||
describe("CircleCiOidcProvider", () => { | ||
it("uses the organization ID as the client ID", () => { | ||
const app = new App(); | ||
const stack = new Stack(app, 'TestStack'); | ||
new CircleCiOidcProvider(stack, 'CircleCiOidcProvider', { | ||
organizationId: '1234', | ||
const stack = new Stack(app, "TestStack"); | ||
new CircleCiOidcProvider(stack, "CircleCiOidcProvider", { | ||
organizationId: "1234", | ||
}); | ||
|
||
Template.fromStack(stack).hasResourceProperties('AWS::IAM::OIDCProvider', { | ||
ClientIdList: ['1234'], | ||
Template.fromStack(stack).hasResourceProperties("AWS::IAM::OIDCProvider", { | ||
ClientIdList: ["1234"], | ||
}); | ||
}); | ||
it('uses a default thumbprint list', () => { | ||
it("uses a default thumbprint list", () => { | ||
const app = new App(); | ||
const stack = new Stack(app, 'TestStack'); | ||
new CircleCiOidcProvider(stack, 'CircleCiOidcProvider', { | ||
organizationId: '1234', | ||
const stack = new Stack(app, "TestStack"); | ||
new CircleCiOidcProvider(stack, "CircleCiOidcProvider", { | ||
organizationId: "1234", | ||
}); | ||
|
||
Template.fromStack(stack).hasResourceProperties('AWS::IAM::OIDCProvider', { | ||
ThumbprintList: ['9e99a48a9960b14926bb7f3b02e22da2b0ab7280'], | ||
Template.fromStack(stack).hasResourceProperties("AWS::IAM::OIDCProvider", { | ||
ThumbprintList: ["9e99a48a9960b14926bb7f3b02e22da2b0ab7280"], | ||
}); | ||
}); | ||
|
||
it('can export a provider for use in other stacks', () => { | ||
it("can export a provider for use in other stacks", () => { | ||
const app = new App(); | ||
const stack = new Stack(app, 'TestStack'); | ||
const provider = new CircleCiOidcProvider(stack, 'CircleCiOidcProvider', { | ||
organizationId: '1234', | ||
const stack = new Stack(app, "TestStack"); | ||
const provider = new CircleCiOidcProvider(stack, "CircleCiOidcProvider", { | ||
organizationId: "1234", | ||
}); | ||
|
||
const accountId = '123456789012'; | ||
const accountId = "123456789012"; | ||
const providerForExport = provider.getProviderForExport(accountId); | ||
|
||
expect(providerForExport.organizationId).toEqual('1234'); | ||
expect(providerForExport.provider.openIdConnectProviderArn).toEqual('arn:aws:iam::123456789012:oidc-provider/oidc.circleci.com/org/1234'); | ||
expect(providerForExport.provider.openIdConnectProviderIssuer).toEqual('oidc.circleci.com/org/1234'); | ||
expect(providerForExport.organizationId).toEqual("1234"); | ||
expect(providerForExport.provider.openIdConnectProviderArn).toEqual( | ||
"arn:aws:iam::123456789012:oidc-provider/oidc.circleci.com/org/1234", | ||
); | ||
expect(providerForExport.provider.openIdConnectProviderIssuer).toEqual( | ||
"oidc.circleci.com/org/1234", | ||
); | ||
}); | ||
}); |
Oops, something went wrong.