Skip to content

Conversation

@rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Nov 21, 2025

perms.ts is accidentally being exported. It only contains a namespace with static const arrays of strings, which are of no use to jsii consumers. These represent IAM actions that are being set inside the library, and don't need to be public to begin with.

Move the file into a directory called private to make it clear it should not be exported, and remove it from the jsii entry point.

Solves this:

2025-11-21 at 16 05

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

`perms.ts` is accidentally being exported. It only contains a namespace
with static const arrays of strings, which are of no use to jsii
consumers. These represent IAM actions that are being set inside the
library, and don't need to be public to begin with.

Move the file into a directory called `private` to make it clear
it should not be exported, and remove it from the jsii entry point.
@rix0rrr rix0rrr requested a review from a team November 21, 2025 15:05
@github-actions github-actions bot added the p2 label Nov 21, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team November 21, 2025 15:05
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Nov 21, 2025
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@rix0rrr rix0rrr added pr-linter/exempt-test The PR linter will not require test changes pr-linter/exempt-integ-test The PR linter will not require integ test changes and removed p2 labels Nov 21, 2025
@rix0rrr rix0rrr changed the title fix(aws-bedrock-agentcore-alpha): empty submodule accidentally exposed fix(bedrock-agentcore-alpha): empty submodule accidentally exposed Nov 21, 2025
@github-actions github-actions bot added the p2 label Nov 21, 2025
@aws-cdk-automation aws-cdk-automation dismissed their stale review November 21, 2025 15:33

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@krokoko
Copy link
Contributor

krokoko commented Nov 21, 2025

@rix0rrr I am working on another PR to fix this
Instead of moving to private I'm removing the namespace, since it can cause issues in other target languages
would that work for you ?

@krokoko
Copy link
Contributor

krokoko commented Nov 21, 2025

#36148

@rix0rrr
Copy link
Contributor Author

rix0rrr commented Nov 21, 2025

Instead of moving to private I'm removing the namespace, since it can cause issues in other target languages

I'm not sure what "it can cause issues" means. The namespace leads to a submodule, which is "fine", though overkill.

But the contents of that namespace/submodule are free constants, and jsii will not pick those up; primarily because they cannot be represented in Java and C#, where everything must be associated with a class.

You could replace the namespace with an abstract class which only exists to hold public static readonly values... but why have these arrays of strings in the first place? Other construct libraries don't have these either, so why would yours?

@rix0rrr
Copy link
Contributor Author

rix0rrr commented Nov 21, 2025

While I've got you here, can you also move all the files from the agentcore/ directory into the lib/ directory?

I'm not sure why lib/index.ts reads:

export * from '../agentcore';

Even though those files could equally well just be in lib directly.

@krokoko
Copy link
Contributor

krokoko commented Nov 21, 2025

but why have these arrays of strings in the first place? Other construct libraries don't have these either, so why would yours?

We had these following the implementation in constructs like https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-s3/lib/perms.ts

@krokoko
Copy link
Contributor

krokoko commented Nov 21, 2025

While I've got you here, can you also move all the files from the agentcore/ directory into the lib/ directory?

I'm not sure why lib/index.ts reads:

export * from '../agentcore';

Even though those files could equally well just be in lib directly.

Done in the PR listed above, removed /agentcore and moved files under /lib. Waiting for build to finish

@alvazjor
Copy link
Contributor

#36148 approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution/core This is a PR that came from AWS. p2 pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exempt-test The PR linter will not require test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants