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

Add gcp_cloud_identity_group_membership and gcp_cloud_identity_group tables. Closes #454 #468

Merged
merged 10 commits into from
Aug 7, 2023

Conversation

karanpopat
Copy link
Contributor

Integration test logs

Logs
Add passing integration test logs here

Example query results

Results
> select
  name,
  group_name,
  create_time,
  type,
  preferred_member_key ->> 'id' as member_id,
  role ->> 'name' as role_name,
  role -> 'expiryDetail' ->> 'expireTime' as role_expiry_time
from
  gcp_cloud_identity_group_membership,
  jsonb_array_elements(roles) as role
where
  group_name = '123j0zll4288gmz'
  and name = '123454620869324818189';

+-----------------------+-----------------+---------------------------+------+-----------------+-----------+------------------+
| name                  | group_name      | create_time               | type | member_id       | role_name | role_expiry_time |
+-----------------------+-----------------+---------------------------+------+-----------------+-----------+------------------+
| 123454620869324818189 | 123j0zll4288gmz | 2019-04-01T20:15:34+05:30 | USER | user@google.com | MEMBER    | <null>           |
+-----------------------+-----------------+---------------------------+------+-----------------+-----------+------------------+

Time: 0.5s. Rows fetched: 1. Hydrate calls: 0.
> select
  name,
  group_name,
  create_time,
  type,
  update_time
from
  gcp_cloud_identity_group_membership
where
  group_name = '123j0zll4288gmz' limit 2;
+-----------------------+-----------------+---------------------------+------+---------------------------+
| name                  | group_name      | create_time               | type | update_time               |
+-----------------------+-----------------+---------------------------+------+---------------------------+
| 123454620869324818181 | 123j0zll4288gmz | 2023-01-13T10:56:05+05:30 | USER | 2023-01-13T10:56:05+05:30 |
| 123454620869324818182 | 123j0zll4288gmz | 2019-04-01T20:15:18+05:30 | USER | 2019-04-01T20:15:18+05:30 |
+-----------------------+-----------------+---------------------------+------+---------------------------+

Time: 0.6s. Rows fetched: 2. Hydrate calls: 0.

@karanpopat karanpopat self-assigned this Jul 17, 2023
@karanpopat karanpopat linked an issue Jul 17, 2023 that may be closed by this pull request
@karanpopat karanpopat changed the title Add table gcp_cloud_identity_group_membership Add table gcp_cloud_identity_group_membership. Closes #454 Jul 17, 2023
@misraved misraved requested a review from ParthaI July 21, 2023 06:05
Copy link
Contributor

@madhushreeray30 madhushreeray30 left a comment

Choose a reason for hiding this comment

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

@karan please can you take a look at the comments? Thanks!

docs/tables/gcp_cloud_identity_group.md Show resolved Hide resolved
gcp/table_gcp_cloud_identity_group.go Outdated Show resolved Hide resolved
gcp/table_gcp_cloud_identity_group.go Outdated Show resolved Hide resolved
gcp/table_gcp_cloud_identity_group.go Outdated Show resolved Hide resolved
Copy link
Contributor

@madhushreeray30 madhushreeray30 left a comment

Choose a reason for hiding this comment

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

@karanpopat please have a look at the comments, thanks!

gcp/plugin.go Show resolved Hide resolved
gcp/table_gcp_cloud_identity_group.go Show resolved Hide resolved
Copy link
Contributor

@madhushreeray30 madhushreeray30 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@misraved misraved changed the title Add table gcp_cloud_identity_group_membership. Closes #454 Add table gcp_cloud_identity_group_membership and gcp_cloud_identity_group tables. Closes #454 Aug 7, 2023
@misraved misraved changed the title Add table gcp_cloud_identity_group_membership and gcp_cloud_identity_group tables. Closes #454 Add gcp_cloud_identity_group_membership and gcp_cloud_identity_group tables. Closes #454 Aug 7, 2023
Copy link
Contributor

@misraved misraved left a comment

Choose a reason for hiding this comment

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

@karanpopat please take a look at the minor review comment 👍.


A Membership defines a relationship between a Group and an entity belonging to that Group, referred to as a "member".

**You must specify the parent resource** under which to list all the `Group` resources. Must be of the form `identitysources/{identity_source}` for external-identity-mapped groups or `customers/{customer}` for Google Groups in the `where` clause (`where parent='C046psxkn'`) to list the identity group memberships.
Copy link
Contributor

Choose a reason for hiding this comment

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

@karanpopat the example queries mentioned by you don't justify the format.

@misraved misraved merged commit d4e89dd into main Aug 7, 2023
1 check passed
@misraved misraved deleted the add_identity_tables branch August 7, 2023 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add table gcp_iam_groups_memberships
3 participants