Skip to content

feat: Provide a decoded policy document field inside aws_iam_policies.policy_version_list#2020

Merged
kodiakhq[bot] merged 4 commits intocloudquery:mainfrom
disq:feat/aws_decoded_policy_document
Sep 23, 2022
Merged

feat: Provide a decoded policy document field inside aws_iam_policies.policy_version_list#2020
kodiakhq[bot] merged 4 commits intocloudquery:mainfrom
disq:feat/aws_decoded_policy_document

Conversation

@disq
Copy link
Copy Markdown
Member

@disq disq commented Sep 22, 2022

This PR adds a DecodedDocument *string field inside the policy_version_list []types.PolicyVersion field.

PolicyVersion type includes an URL-encoded policy document, which is no use to run policies with.

The alternative is this which is extra slow.

@disq disq requested review from a team, hermanschaaf and yevgenypats September 22, 2022 18:42
@cq-bot cq-bot added the aws label Sep 22, 2022
Copy link
Copy Markdown
Contributor

@hermanschaaf hermanschaaf left a comment

Choose a reason for hiding this comment

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

Nice catch! I think we should probably decode the Document and place it back in the Document field, rather than introducing a non-standard DecodedDocument field that users will not be able to find in the documentation. This seems okay, we're doing the minimal transformation to make the data useful. What do you think?

@disq
Copy link
Copy Markdown
Member Author

disq commented Sep 23, 2022

place it back in the Document field

My concern here would be an invalid/undecodable document and what to do with its value.

@yevgenypats
Copy link
Copy Markdown
Contributor

Nice catch! I think we should probably decode the Document and place it back in the Document field, rather than introducing a non-standard DecodedDocument field that users will not be able to find in the documentation. This seems okay, we're doing the minimal transformation to make the data useful. What do you think?

This seems right.

@disq What do you mean by invalid?

@hermanschaaf
Copy link
Copy Markdown
Contributor

My concern here would be an invalid/undecodable document and what to do with its value.

I think we can treat that as an error: it's AWS not upholding its contract with us, since the docs for PolicyVersion explicitly say:

The policy document returned in this structure is URL-encoded compliant with RFC 3986 (https://tools.ietf.org/html/rfc3986)

@disq
Copy link
Copy Markdown
Member Author

disq commented Sep 23, 2022

by invalid I thought wrong specified policies would lead to failure to decode, but that obviously can't happen because we're not trying to unmarshal the json (the user supplied...) but merely decoding something from the protocol. So yeah, it shouldn't happen.

@disq disq requested a review from hermanschaaf September 23, 2022 08:31
@disq disq added the automerge Automatically merge once required checks pass label Sep 23, 2022
@kodiakhq kodiakhq bot merged commit e7c51e1 into cloudquery:main Sep 23, 2022
@disq disq deleted the feat/aws_decoded_policy_document branch September 23, 2022 08:54
yevgenypats pushed a commit that referenced this pull request Sep 26, 2022
🤖 I have created a release *beep* *boop*
---


##
[0.15.0-pre.0](plugins-source-aws-v0.14.2-pre.0...plugins-source-aws-v0.15.0-pre.0)
(2022-09-26)


### Features

* Add first draft of AWS v2 migration guide
([#1992](#1992))
([6acae93](6acae93))
* Provide a decoded policy document field inside
aws_iam_policies.policy_version_list
([#2020](#2020))
([e7c51e1](e7c51e1))


### Bug Fixes

* Add missing fields to aws_iam_policies
([#2005](#2005))
([24a22cb](24a22cb))
* Autofilling aws plugin default config values
([#1935](#1935))
([ddb98a1](ddb98a1))
* AWS EBS Snapshots attributes column type
([#2075](#2075))
([30ca062](30ca062))
* AWS EBS Snapshots attributes column type (take two)
([#2077](#2077))
([899771b](899771b))
* AWS Policy for RDS public accessibility
([#2060](#2060))
([9cde8a0](9cde8a0))
* AWS redshift cluster parameters
([#2063](#2063))
([9b9ff9d](9b9ff9d)),
closes [#1979](#1979)
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.7.13
([#1954](#1954))
([2ee4718](2ee4718))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.8.0
([#1997](#1997))
([4fa40da](4fa40da))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.8.1
([#2024](#2024))
([8f88de4](8f88de4))
* **deps:** Update module github.com/cloudquery/plugin-sdk to v0.8.2
([#2044](#2044))
([9b69b46](9b69b46))
* Fix applicationautoscaling multiplexing (v2)
([#2009](#2009))
([4ea6026](4ea6026))
* Fix columns of aws_iam_openid_connect_identity_providers (v2)
([#2001](#2001))
([d378672](d378672))
* Remove underscores in ec_2, s_3 and others
([#1998](#1998))
([0df193f](0df193f))
* Update endpoints
([#2019](#2019))
([0e83552](0e83552))
* Update endpoints
([#2037](#2037))
([4719ca4](4719ca4))
* Update endpoints
([#2080](#2080))
([889bef2](889bef2))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Automatically merge once required checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants