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 table okta_app_assigned_group. Closes #49 #50

Merged
merged 5 commits into from
Jan 12, 2022
Merged

Conversation

c0d3r-arnab
Copy link
Contributor

@c0d3r-arnab c0d3r-arnab commented Dec 21, 2021

Example query results

Results
> select
  id as group_id,
  app_id,
  last_updated,
  priority
from
  okta_app_assigned_group;
+----------------------+----------------------+---------------------------+----------+
| group_id             | app_id               | last_updated              | priority |
+----------------------+----------------------+---------------------------+----------+
| 00g33kzj6xOZvlBUQ5d7 | 0oa1mf9l3dw26foa25d7 | 2021-12-10T15:54:03+05:30 | 0        |
+----------------------+----------------------+---------------------------+----------+
> select
  grp.name as name,
  grp.description as description,
  jsonb_pretty(grp.group_members) as group_members
from
  okta_group grp
full outer join okta_app_assigned_group ag on grp.id = ag.id
where
  grp.id is null or ag.id is null;
+---------------+--------------------------------+----------------------------------------+
| name          | description                    | group_members                          |
+---------------+--------------------------------+----------------------------------------+
| Everyone      | All users in your organization | [                                      |
|               |                                |     {                                  |
|               |                                |         "id": "00u1kcigdvWtR96HY5d7",  |
|               |                                |         "email": "arnab@turbot.com",   |
|               |                                |         "login": "arnab@turbot.com"    |
|               |                                |     },                                 |
|               |                                |     {                                  |
|               |                                |         "id": "00u33m8oarePFyaTm5d7",  |
|               |                                |         "email": "arnabg57@gmail.com", |
|               |                                |         "login": "arnabg57@gmail.com"  |
|               |                                |     },                                 |
|               |                                |     {                                  |
|               |                                |         "id": "00u3e9oo5e7hR6X815d7",  |
|               |                                |         "email": "testUser@gmail.com", |
|               |                                |         "login": "testUser@gmail.com"  |
|               |                                |     }                                  |
|               |                                | ]                                      |
| Another Group | This is another group          | [                                      |
|               |                                |     {                                  |
|               |                                |         "id": "00u33m8oarePFyaTm5d7",  |
|               |                                |         "email": "arnabg57@gmail.com", |
|               |                                |         "login": "arnabg57@gmail.com"  |
|               |                                |     }                                  |
|               |                                | ]                                      |
+---------------+--------------------------------+----------------------------------------+
> select
  app.name as app_name,
  app.id as app_id,
  app.created as app_created,
  app.status as app_status,
  ag.id as group_id,
  grp.name as group_name,
  grp.description as group_description,
  jsonb_pretty(grp.group_members) as group_members
from
  okta_application app
left join okta_app_assigned_group ag on app.id = ag.app_id
left join okta_group grp on ag.id = grp.id;
+---------------------+----------------------+---------------------------+------------+----------------------+------------+----------------------+----------------------------------------+
| app_name            | app_id               | app_created               | app_status | group_id             | group_name | group_description    | group_members                          |
+---------------------+----------------------+---------------------------+------------+----------------------+------------+----------------------+----------------------------------------+
| okta_enduser        | 0oa1kchdrfcXTbEzV5d7 | 2021-08-26T09:56:36+05:30 | ACTIVE     | <null>               | <null>     | <null>               | <null>                                 |
| saasure             | 0oa1kchdmerpZir9y5d7 | 2021-08-26T09:56:28+05:30 | ACTIVE     | <null>               | <null>     | <null>               | <null>                                 |
| okta_browser_plugin | 0oa1kcigd9Kob07k05d7 | 2021-08-26T09:56:36+05:30 | ACTIVE     | <null>               | <null>     | <null>               | <null>                                 |
| oidc_client         | 0oa1mf49z9iZurdzA5d7 | 2021-08-31T18:01:44+05:30 | ACTIVE     | <null>               | <null>     | <null>               | <null>                                 |
| oidc_client         | 0oa1mf9l3dw26foa25d7 | 2021-08-31T18:16:30+05:30 | ACTIVE     | 00g33kzj6xOZvlBUQ5d7 | TestGroup  | This is a test group | [                                      |
|                     |                      |                           |            |                      |            |                      |     {                                  |
|                     |                      |                           |            |                      |            |                      |         "id": "00u33m8oarePFyaTm5d7",  |
|                     |                      |                           |            |                      |            |                      |         "email": "arnabg57@gmail.com", |
|                     |                      |                           |            |                      |            |                      |         "login": "arnabg57@gmail.com"  |
|                     |                      |                           |            |                      |            |                      |     }                                  |
|                     |                      |                           |            |                      |            |                      | ]                                      |
+---------------------+----------------------+---------------------------+------------+----------------------+------------+----------------------+----------------------------------------+

@c0d3r-arnab c0d3r-arnab self-assigned this Dec 21, 2021
@c0d3r-arnab c0d3r-arnab linked an issue Dec 21, 2021 that may be closed by this pull request
@c0d3r-arnab c0d3r-arnab changed the title Add table okta_application_group Add table okta_application_group. Closes #49 Dec 21, 2021
@c0d3r-arnab c0d3r-arnab changed the title Add table okta_application_group. Closes #49 Add table okta_app_group_assignment. Closes #49 Dec 22, 2021
@c0d3r-arnab c0d3r-arnab changed the title Add table okta_app_group_assignment. Closes #49 Add table okta_app_assigned_group. Closes #49 Jan 7, 2022
Copy link

@bigdatasourav bigdatasourav left a comment

Choose a reason for hiding this comment

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

LGTM

@bigdatasourav bigdatasourav merged commit 6572f29 into main Jan 12, 2022
@bigdatasourav bigdatasourav deleted the issue-49 branch January 12, 2022 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants