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

Fix GET API call in table okta_application. Closes #40 #46

Merged
merged 1 commit into from
Jan 12, 2022

Conversation

c0d3r-arnab
Copy link
Contributor

Example query results

Results
> select
  name,
  id,
  label,
  created,
  status,
  sign_on_mode
from
  okta_application;
+---------------------+----------------------+----------------------+----------------------+--------+----------------+
| name                | id                   | label                | created              | status | sign_on_mode   |
+---------------------+----------------------+----------------------+----------------------+--------+----------------+
| oidc_client         | 0oa1mf49z9iZurdzA5d7 | Service Client Name  | 2021-08-31T12:31:44Z | ACTIVE | OPENID_CONNECT |
| okta_enduser        | 0oa1kchdrfcXTbEzV5d7 | Okta Dashboard       | 2021-08-26T04:26:36Z | ACTIVE | OPENID_CONNECT |
| okta_browser_plugin | 0oa1kcigd9Kob07k05d7 | Okta Browser Plugin  | 2021-08-26T04:26:36Z | ACTIVE | OPENID_CONNECT |
| saasure             | 0oa1kchdmerpZir9y5d7 | Okta Admin Console   | 2021-08-26T04:26:28Z | ACTIVE | OPENID_CONNECT |
| oidc_client         | 0oa1mf9l3dw26foa25d7 | Test Private KeyPair | 2021-08-31T12:46:30Z | ACTIVE | OPENID_CONNECT |
+---------------------+----------------------+----------------------+----------------------+--------+----------------+
> select
  name,
  id,
  label,
  created,
  status,
  sign_on_mode
from
  okta_application
where
  sign_on_mode = 'SAML_2_0';
+------+----+-------+---------+--------+--------------+
| name | id | label | created | status | sign_on_mode |
+------+----+-------+---------+--------+--------------+
+------+----+-------+---------+--------+--------------+
> select
  id,
  label,
  name,
  sign_on_mode,
  status
from
  okta_application as app
where
  filter = 'user.id eq "00u1kcigdvWtR96HY5d7"';
+----------------------+----------------------+-------------+----------------+--------+
| id                   | label                | name        | sign_on_mode   | status |
+----------------------+----------------------+-------------+----------------+--------+
| 0oa1mf9l3dw26foa25d7 | Test Private KeyPair | oidc_client | OPENID_CONNECT | ACTIVE |
| 0oa1mf49z9iZurdzA5d7 | Service Client Name  | oidc_client | OPENID_CONNECT | ACTIVE |
+----------------------+----------------------+-------------+----------------+--------+
> select
  id,
  label,
  name,
  sign_on_mode,
  status
from
  okta_application
where
  filter = 'group.id eq "00g33kzj6xOZvlBUQ5d7"';
+----------------------+----------------------+-------------+----------------+--------+
| id                   | label                | name        | sign_on_mode   | status |
+----------------------+----------------------+-------------+----------------+--------+
| 0oa1mf9l3dw26foa25d7 | Test Private KeyPair | oidc_client | OPENID_CONNECT | ACTIVE |
+----------------------+----------------------+-------------+----------------+--------+
> select 
  name,
  id, 
  label, 
  jsonb_pretty(assigned_users) as assigned_users
from
  okta_application;
+---------------------+----------------------+----------------------+-------------------------------------------------------------------------------------------+
| name                | id                   | label                | assigned_users                                                                            |
+---------------------+----------------------+----------------------+-------------------------------------------------------------------------------------------+
| okta_enduser        | 0oa1kchdrfcXTbEzV5d7 | Okta Dashboard       | [                                                                                         |
|                     |                      |                      | ]                                                                                         |
| okta_browser_plugin | 0oa1kcigd9Kob07k05d7 | Okta Browser Plugin  | [                                                                                         |
|                     |                      |                      | ]                                                                                         |
| saasure             | 0oa1kchdmerpZir9y5d7 | Okta Admin Console   | [                                                                                         |
|                     |                      |                      |     {                                                                                     |
|                     |                      |                      |         "id": "00u1kcigdvWtR96HY5d7",                                                     |
|                     |                      |                      |         "scope": "USER",                                                                  |
|                     |                      |                      |         "_links": {                                                                       |
|                     |                      |                      |             "app": {                                                                      |
|                     |                      |                      |                 "href": "https://dev-21314997.okta.com/api/v1/apps/0oa1kchdmerpZir9y5d7"  |
|                     |                      |                      |             },                                                                            |
|                     |                      |                      |             "user": {                                                                     |
|                     |                      |                      |                 "href": "https://dev-21314997.okta.com/api/v1/users/00u1kcigdvWtR96HY5d7" |
|                     |                      |                      |             }                                                                             |
|                     |                      |                      |         },                                                                                |
|                     |                      |                      |         "status": "ACTIVE",                                                               |
|                     |                      |                      |         "created": "2021-08-26T04:26:37Z",                                                |
|                     |                      |                      |         "profile": {                                                                      |
|                     |                      |                      |         },                                                                                |
|                     |                      |                      |         "syncState": "DISABLED",                                                          |
|                     |                      |                      |         "lastUpdated": "2021-08-26T04:26:37Z",                                            |
|                     |                      |                      |         "statusChanged": "2021-08-26T04:26:37Z"                                           |
|                     |                      |                      |     }                                                                                     |
|                     |                      |                      | ]                                                                                         |
| oidc_client         | 0oa1mf9l3dw26foa25d7 | Test Private KeyPair | [                                                                                         |
|                     |                      |                      |     {                                                                                     |
|                     |                      |                      |         "id": "00u1kcigdvWtR96HY5d7",                                                     |
|                     |                      |                      |         "scope": "USER",                                                                  |
|                     |                      |                      |         "_links": {                                                                       |
|                     |                      |                      |             "app": {                                                                      |
|                     |                      |                      |                 "href": "https://dev-21314997.okta.com/api/v1/apps/0oa1mf9l3dw26foa25d7"  |
|                     |                      |                      |             },                                                                            |
|                     |                      |                      |             "user": {                                                                     |
|                     |                      |                      |                 "href": "https://dev-21314997.okta.com/api/v1/users/00u1kcigdvWtR96HY5d7" |
|                     |                      |                      |             }                                                                             |
|                     |                      |                      |         },                                                                                |
|                     |                      |                      |         "status": "ACTIVE",                                                               |
|                     |                      |                      |         "created": "2021-12-10T07:13:42Z",                                                |
|                     |                      |                      |         "profile": {                                                                      |
|                     |                      |                      |             "name": "Arnab Ghosh",                                                        |
|                     |                      |                      |             "email": "arnab@turbot.com",                                                  |
|                     |                      |                      |             "gender": null,                                                               |
|                     |                      |                      |             "locale": "en-US",                                                            |
|                     |                      |                      |             "region": null,                                                               |
|                     |                      |                      |             "country": null,                                                              |
|                     |                      |                      |             "picture": null,                                                              |
|                     |                      |                      |             "profile": null,                                                              |
|                     |                      |                      |             "website": null,                                                              |
|                     |                      |                      |             "locality": null,                                                             |
|                     |                      |                      |             "nickname": null,                                                             |
|                     |                      |                      |             "zoneinfo": "America/Los_Angeles",                                            |
|                     |                      |                      |             "birthdate": null,                                                            |
|                     |                      |                      |             "formatted": null,                                                            |
|                     |                      |                      |             "given_name": "Arnab",                                                        |
|                     |                      |                      |             "family_name": "Ghosh",                                                       |
|                     |                      |                      |             "middle_name": null,                                                          |
|                     |                      |                      |             "postal_code": null,                                                          |
|                     |                      |                      |             "phone_number": null,                                                         |
|                     |                      |                      |             "street_address": null                                                        |
|                     |                      |                      |         },                                                                                |
|                     |                      |                      |         "syncState": "DISABLED",                                                          |
|                     |                      |                      |         "credentials": {                                                                  |
|                     |                      |                      |             "userName": "arnab@turbot.com"                                                |
|                     |                      |                      |         },                                                                                |
|                     |                      |                      |         "lastUpdated": "2021-12-10T09:34:59Z",                                            |
|                     |                      |                      |         "statusChanged": "2021-12-10T07:13:42Z"                                           |
|                     |                      |                      |     },                                                                                    |
|                     |                      |                      |     {                                                                                     |
|                     |                      |                      |         "id": "00u33m8oarePFyaTm5d7",                                                     |
|                     |                      |                      |         "scope": "USER",                                                                  |
|                     |                      |                      |         "_links": {                                                                       |
|                     |                      |                      |             "app": {                                                                      |
|                     |                      |                      |                 "href": "https://dev-21314997.okta.com/api/v1/apps/0oa1mf9l3dw26foa25d7"  |
|                     |                      |                      |             },                                                                            |
|                     |                      |                      |             "user": {                                                                     |
|                     |                      |                      |                 "href": "https://dev-21314997.okta.com/api/v1/users/00u33m8oarePFyaTm5d7" |
|                     |                      |                      |             }                                                                             |
|                     |                      |                      |         },                                                                                |
|                     |                      |                      |         "status": "ACTIVE",                                                               |
|                     |                      |                      |         "created": "2021-12-10T10:49:28Z",                                                |
|                     |                      |                      |         "profile": {                                                                      |
|                     |                      |                      |             "name": "Soura Ghosh",                                                        |
|                     |                      |                      |             "email": "arnabg57@gmail.com",                                                |
|                     |                      |                      |             "gender": null,                                                               |
|                     |                      |                      |             "locale": "en-US",                                                            |
|                     |                      |                      |             "region": null,                                                               |
|                     |                      |                      |             "country": null,                                                              |
|                     |                      |                      |             "picture": null,                                                              |
|                     |                      |                      |             "profile": null,                                                              |
|                     |                      |                      |             "website": null,                                                              |
|                     |                      |                      |             "locality": null,                                                             |
|                     |                      |                      |             "nickname": null,                                                             |
|                     |                      |                      |             "zoneinfo": "America/Los_Angeles",                                            |
|                     |                      |                      |             "birthdate": null,                                                            |
|                     |                      |                      |             "formatted": null,                                                            |
|                     |                      |                      |             "given_name": "Soura",                                                        |
|                     |                      |                      |             "family_name": "Ghosh",                                                       |
|                     |                      |                      |             "middle_name": null,                                                          |
|                     |                      |                      |             "postal_code": null,                                                          |
|                     |                      |                      |             "phone_number": null,                                                         |
|                     |                      |                      |             "street_address": null                                                        |
|                     |                      |                      |         },                                                                                |
|                     |                      |                      |         "syncState": "DISABLED",                                                          |
|                     |                      |                      |         "lastUpdated": "2021-12-10T10:49:28Z",                                            |
|                     |                      |                      |         "statusChanged": "2021-12-10T10:49:28Z"                                           |
|                     |                      |                      |     }                                                                                     |
|                     |                      |                      | ]                                                                                         |
| oidc_client         | 0oa1mf49z9iZurdzA5d7 | Service Client Name  | [                                                                                         |
|                     |                      |                      |     {                                                                                     |
|                     |                      |                      |         "id": "00u1kcigdvWtR96HY5d7",                                                     |
|                     |                      |                      |         "scope": "USER",                                                                  |
|                     |                      |                      |         "_links": {                                                                       |
|                     |                      |                      |             "app": {                                                                      |
|                     |                      |                      |                 "href": "https://dev-21314997.okta.com/api/v1/apps/0oa1mf49z9iZurdzA5d7"  |
|                     |                      |                      |             },                                                                            |
|                     |                      |                      |             "user": {                                                                     |
|                     |                      |                      |                 "href": "https://dev-21314997.okta.com/api/v1/users/00u1kcigdvWtR96HY5d7" |
|                     |                      |                      |             }                                                                             |
|                     |                      |                      |         },                                                                                |
|                     |                      |                      |         "status": "ACTIVE",                                                               |
|                     |                      |                      |         "created": "2021-12-10T07:13:42Z",                                                |
|                     |                      |                      |         "profile": {                                                                      |
|                     |                      |                      |             "name": "Arnab Ghosh",                                                        |
|                     |                      |                      |             "email": "arnab@turbot.com",                                                  |
|                     |                      |                      |             "gender": null,                                                               |
|                     |                      |                      |             "locale": "en-US",                                                            |
|                     |                      |                      |             "region": null,                                                               |
|                     |                      |                      |             "country": null,                                                              |
|                     |                      |                      |             "picture": null,                                                              |
|                     |                      |                      |             "profile": null,                                                              |
|                     |                      |                      |             "website": null,                                                              |
|                     |                      |                      |             "locality": null,                                                             |
|                     |                      |                      |             "nickname": null,                                                             |
|                     |                      |                      |             "zoneinfo": "America/Los_Angeles",                                            |
|                     |                      |                      |             "birthdate": null,                                                            |
|                     |                      |                      |             "formatted": null,                                                            |
|                     |                      |                      |             "given_name": "Arnab",                                                        |
|                     |                      |                      |             "family_name": "Ghosh",                                                       |
|                     |                      |                      |             "middle_name": null,                                                          |
|                     |                      |                      |             "postal_code": null,                                                          |
|                     |                      |                      |             "phone_number": null,                                                         |
|                     |                      |                      |             "street_address": null                                                        |
|                     |                      |                      |         },                                                                                |
|                     |                      |                      |         "syncState": "DISABLED",                                                          |
|                     |                      |                      |         "lastUpdated": "2021-12-10T07:13:42Z",                                            |
|                     |                      |                      |         "statusChanged": "2021-12-10T07:13:42Z"                                           |
|                     |                      |                      |     }                                                                                     |
|                     |                      |                      | ]                                                                                         |
+---------------------+----------------------+----------------------+-------------------------------------------------------------------------------------------+
> select 
  name,
  id, 
  label, 
  jsonb_pretty(assigned_groups) as assigned_groups
from
  okta_application;
+---------------------+----------------------+----------------------+----------------------------------------------------------------------------------------------------------------------+
| name                | id                   | label                | assigned_groups                                                                                                      |
+---------------------+----------------------+----------------------+----------------------------------------------------------------------------------------------------------------------+
| okta_browser_plugin | 0oa1kcigd9Kob07k05d7 | Okta Browser Plugin  | [                                                                                                                    |
|                     |                      |                      | ]                                                                                                                    |
| okta_enduser        | 0oa1kchdrfcXTbEzV5d7 | Okta Dashboard       | [                                                                                                                    |
|                     |                      |                      | ]                                                                                                                    |
| oidc_client         | 0oa1mf49z9iZurdzA5d7 | Service Client Name  | [                                                                                                                    |
|                     |                      |                      | ]                                                                                                                    |
| saasure             | 0oa1kchdmerpZir9y5d7 | Okta Admin Console   | [                                                                                                                    |
|                     |                      |                      | ]                                                                                                                    |
| oidc_client         | 0oa1mf9l3dw26foa25d7 | Test Private KeyPair | [                                                                                                                    |
|                     |                      |                      |     {                                                                                                                |
|                     |                      |                      |         "id": "00g33kzj6xOZvlBUQ5d7",                                                                                |
|                     |                      |                      |         "_links": {                                                                                                  |
|                     |                      |                      |             "app": {                                                                                                 |
|                     |                      |                      |                 "href": "https://dev-21314997.okta.com/api/v1/apps/0oa1mf9l3dw26foa25d7"                             |
|                     |                      |                      |             },                                                                                                       |
|                     |                      |                      |             "self": {                                                                                                |
|                     |                      |                      |                 "href": "https://dev-21314997.okta.com/api/v1/apps/0oa1mf9l3dw26foa25d7/groups/00g33kzj6xOZvlBUQ5d7" |
|                     |                      |                      |             },                                                                                                       |
|                     |                      |                      |             "group": {                                                                                               |
|                     |                      |                      |                 "href": "https://dev-21314997.okta.com/api/v1/groups/00g33kzj6xOZvlBUQ5d7"                           |
|                     |                      |                      |             }                                                                                                        |
|                     |                      |                      |         },                                                                                                           |
|                     |                      |                      |         "profile": {                                                                                                 |
|                     |                      |                      |         },                                                                                                           |
|                     |                      |                      |         "lastUpdated": "2021-12-10T10:24:03Z"                                                                        |
|                     |                      |                      |     }                                                                                                                |
|                     |                      |                      | ]                                                                                                                    |
+---------------------+----------------------+----------------------+----------------------------------------------------------------------------------------------------------------------+
> select * from okta_application where id = '0oa1kchdmerpZir9y5d7';
+---------+----------------------+--------------------+----------------------+--------+----------------------+--------+----------------+--------------------------------------------------------------------------+----------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------+---------+
| name    | id                   | label              | created              | filter | last_updated         | status | sign_on_mode   | settings                                                                 | visibility                                                                             | credentials                                                                                                                           | accessibility         | assigned_users                                                                                                                                                                                                                                                                                                                                                                                 | assigned_groups | title   |
+---------+----------------------+--------------------+----------------------+--------+----------------------+--------+----------------+--------------------------------------------------------------------------+----------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------+---------+
| saasure | 0oa1kchdmerpZir9y5d7 | Okta Admin Console | 2021-08-26T04:26:28Z | <null> | 2021-08-26T04:26:29Z | ACTIVE | OPENID_CONNECT | {"app":{},"notifications":{"vpn":{"network":{"connection":"DISABLED"}}}} | {"appLinks":{"admin":true},"autoSubmitToolbar":false,"hide":{"iOS":false,"web":false}} | {"signing":{"kid":"Ol0IHjRMi3li1JrL0TgnSRw36SoYFvpDjYc2RWE5Umg"},"userNameTemplate":{"template":"${source.login}","type":"BUILT_IN"}} | {"selfService":false} | [{"_links":{"app":{"href":"https://dev-21314997.okta.com/api/v1/apps/0oa1kchdmerpZir9y5d7"},"user":{"href":"https://dev-21314997.okta.com/api/v1/users/00u1kcigdvWtR96HY5d7"}},"created":"2021-08-26T04:26:37Z","id":"00u1kcigdvWtR96HY5d7","lastUpdated":"2021-08-26T04:26:37Z","profile":{},"scope":"USER","status":"ACTIVE","statusChanged":"2021-08-26T04:26:37Z","syncState":"DISABLED"}] | []              | saasure |
+---------+----------------------+--------------------+----------------------+--------+----------------------+--------+----------------+--------------------------------------------------------------------------+----------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------+---------+

@c0d3r-arnab c0d3r-arnab self-assigned this Dec 16, 2021
@c0d3r-arnab c0d3r-arnab linked an issue Dec 20, 2021 that may be closed by this pull request
Copy link
Contributor

@ParthaI ParthaI 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 dcb3cf7 into main Jan 12, 2022
@bigdatasourav bigdatasourav deleted the issue-40 branch January 12, 2022 07:59
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.

Fix GET API call in table okta_application
3 participants