Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws-s3: Bad type definition for objectsKeyPattern parameter #27481

Closed
azatoth opened this issue Oct 10, 2023 · 2 comments · Fixed by #28176
Closed

aws-s3: Bad type definition for objectsKeyPattern parameter #27481

azatoth opened this issue Oct 10, 2023 · 2 comments · Fixed by #28176
Assignees
Labels
@aws-cdk/aws-s3 Related to Amazon S3 bug This issue is a bug. documentation This is a problem with documentation. effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md p2

Comments

@azatoth
Copy link
Contributor

azatoth commented Oct 10, 2023

Describe the issue

The parameter objectsKeyPattern for grantRead(identity, objectsKeyPattern?) has the type any; But it seems it needs to be a string and nothing else.
I initially thought the parameter had to be a object due to the name.

Same wrong type is found for

  • grantDelete(identity, objectsKeyPattern?)
  • grantPut(identity, objectsKeyPattern?)
  • grantReadWrite(identity, objectsKeyPattern?)
  • grantWrite(identity, objectsKeyPattern?, allowedActionPatterns?)

Incidentally grantPutAcl(identity, objectsKeyPattern?) has correct type.

Links

@azatoth azatoth added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Oct 10, 2023
@github-actions github-actions bot added the @aws-cdk/aws-s3 Related to Amazon S3 label Oct 10, 2023
@peterwoodworth
Copy link
Contributor

on a quick look, it looks like this value is only used to pass into arnForObjects which requires a string

public arnForObjects(keyPattern: string): string {

Thanks for reporting 🙂

@peterwoodworth peterwoodworth added good first issue Related to contributions. See CONTRIBUTING.md p2 effort/small Small work item – less than a day of effort bug This issue is a bug. and removed needs-triage This issue or PR still needs to be triaged. labels Oct 10, 2023
alinasir85 added a commit to alinasir85/aws-cdk that referenced this issue Oct 10, 2023
@paulhcsun paulhcsun self-assigned this Nov 28, 2023
@mergify mergify bot closed this as completed in #28176 Nov 29, 2023
mergify bot pushed a commit that referenced this issue Nov 29, 2023
Improve docstrings to explain that parameter objectsKeyPattern of type any should take in string inputs.

Unable to directly change the parameter type because of backwards compatibility concerns (mentioned in #27486 we are improving documentation as an alternative solution.

Closes #27481.

----

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

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

chenjane-dev pushed a commit to chenjane-dev/aws-cdk that referenced this issue Dec 5, 2023
)

Improve docstrings to explain that parameter objectsKeyPattern of type any should take in string inputs.

Unable to directly change the parameter type because of backwards compatibility concerns (mentioned in aws#27486 we are improving documentation as an alternative solution.

Closes aws#27481.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-s3 Related to Amazon S3 bug This issue is a bug. documentation This is a problem with documentation. effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md p2
Projects
None yet
3 participants