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_trusted_origin. Closes #15 #31

Merged
merged 6 commits into from
Sep 2, 2021
Merged

Add table okta_trusted_origin. Closes #15 #31

merged 6 commits into from
Sep 2, 2021

Conversation

c0d3r-arnab
Copy link
Contributor

@c0d3r-arnab c0d3r-arnab commented Aug 30, 2021

Example query results

Results
> select
  name,
  id,
  created,
  last_updated,
  origin,
  scopes,
  status
from
  okta_trusted_origin;
2021-09-01T21:59:18.274+0530 [TRACE] steampipe: executor in
⠼ Loading results... 2021-09-01T21:59:19.781+0530 [TRACE] steampipe: restartInteractiveSession
2021-09-01T21:59:19.782+0530 [TRACE] steampipe: Close prompt - then 1
2021-09-01T21:59:19.782+0530 [TRACE] steampipe: executor out
+----------------------+----------------------+---------------------+---------------------+------------------+---------------------------------------+--------+
| name                 | id                   | created             | last_updated        | origin           | scopes                                | status |
+----------------------+----------------------+---------------------+---------------------+------------------+---------------------------------------+--------+
| test-origin-redirect | tos1l3v1djOJMSQkh5d7 | 2021-08-27 07:44:15 | 2021-08-30 10:28:20 | http://test.com  | [{"type":"REDIRECT"}]                 | ACTIVE |
| Test CORS            | tos1m59anpeSM4if95d7 | 2021-08-30 10:28:43 | 2021-09-01 07:09:45 | http://test2.com | [{"type":"CORS"},{"type":"REDIRECT"}] | ACTIVE |
+----------------------+----------------------+---------------------+---------------------+------------------+---------------------------------------+--------+
> select
  name,
  id,
  created,
  last_updated,
  origin,
  scopes,
  status
from
  okta_trusted_origin
where
  last_updated < current_timestamp - interval '30 days';
2021-09-01T21:59:28.420+0530 [TRACE] steampipe: executor in
2021-09-01T21:59:28.434+0530 [TRACE] steampipe: restartInteractiveSession
2021-09-01T21:59:28.434+0530 [TRACE] steampipe: Close prompt - then 1
2021-09-01T21:59:28.434+0530 [TRACE] steampipe: executor out
+------+----+---------+--------------+--------+--------+--------+
| name | id | created | last_updated | origin | scopes | status |
+------+----+---------+--------------+--------+--------+--------+
+------+----+---------+--------------+--------+--------+--------+
> select
  name,
  id,
  created,
  last_updated,
  origin,
  scopes,
  status
from
  okta_trusted_origin
where
  scopes @> '[{"type":"CORS"}]'::jsonb;
2021-09-01T21:59:35.946+0530 [TRACE] steampipe: executor in
2021-09-01T21:59:35.951+0530 [TRACE] steampipe: restartInteractiveSession
2021-09-01T21:59:35.951+0530 [TRACE] steampipe: Close prompt - then 1
2021-09-01T21:59:35.951+0530 [TRACE] steampipe: executor out
+-----------+----------------------+---------------------+---------------------+------------------+---------------------------------------+--------+
| name      | id                   | created             | last_updated        | origin           | scopes                                | status |
+-----------+----------------------+---------------------+---------------------+------------------+---------------------------------------+--------+
| Test CORS | tos1m59anpeSM4if95d7 | 2021-08-30 10:28:43 | 2021-09-01 07:09:45 | http://test2.com | [{"type":"CORS"},{"type":"REDIRECT"}] | ACTIVE |
+-----------+----------------------+---------------------+---------------------+------------------+---------------------------------------+--------+
>

@c0d3r-arnab c0d3r-arnab requested a review from ParthaI August 30, 2021 10:44
@c0d3r-arnab c0d3r-arnab self-assigned this Aug 30, 2021
@c0d3r-arnab c0d3r-arnab linked an issue Aug 30, 2021 that may be closed by this pull request
@c0d3r-arnab c0d3r-arnab requested a review from LalitLab September 1, 2021 07:15

app, _, err := client.TrustedOrigin.GetOrigin(ctx, trustedOriginId)
if err != nil {
logger.Error("getOktaTrustedOrigin", "get application", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Update the error message.

okta_trusted_origin;
```

### List trusted origins last updated for more than 30 days
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
### List trusted origins last updated for more than 30 days
### List trusted origins for more than 30 days of last updated

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

okta_trusted_origin;
```

### List trusted origins for more than 30 days since last updated
Copy link
Contributor

@LalitLab LalitLab Sep 1, 2021

Choose a reason for hiding this comment

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

Suggested change
### List trusted origins for more than 30 days since last updated
### List trusted origins last updated 30 days ago


// JSON Columns
{Name: "scopes", Type: proto.ColumnType_JSON, Description: "The scopes for the trusted origin. Valid values are 'CORS' or 'REDIRECT'."},
{Name: "links", Type: proto.ColumnType_JSON, Description: "The trusted origin link properties."},
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{Name: "links", Type: proto.ColumnType_JSON, Description: "The trusted origin link properties."},

Copy link
Contributor

Choose a reason for hiding this comment

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

Update examples for the change

func tableOktaTrustedOrigin() *plugin.Table {
return &plugin.Table{
Name: "okta_trusted_origin",
Description: "Okta Trusted Origin",
Copy link
Contributor

Choose a reason for hiding this comment

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

Update it some usefult de

Suggested change
Description: "Okta Trusted Origin",
Description: "Trusted Origin is a security-based concept that combines the URI scheme, hostname, and port number of a page.",

Copy link
Contributor

@LalitLab LalitLab left a comment

Choose a reason for hiding this comment

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

@c0d3r-arnab left few comments

Copy link
Contributor

@LalitLab LalitLab left a comment

Choose a reason for hiding this comment

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

LGTM

@LalitLab LalitLab merged commit 527225f into main Sep 2, 2021
@LalitLab LalitLab deleted the issue-15 branch September 2, 2021 09:48
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 okta_trusted_origin
3 participants