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_factor. Closes #17 #30

Merged
merged 12 commits into from
Sep 2, 2021
Merged

Add table okta_factor. Closes #17 #30

merged 12 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
  id,
  user_id,
  factor_type,
  created,
  status
from
  okta_factor;
2021-09-01T22:09:21.631+0530 [TRACE] steampipe: executor in
⠇ Loading results... 2021-09-01T22:09:23.484+0530 [TRACE] steampipe: restartInteractiveSession
2021-09-01T22:09:23.484+0530 [TRACE] steampipe: Close prompt - then 1
2021-09-01T22:09:23.484+0530 [TRACE] steampipe: executor out
+----------------------+----------------------+---------------------+---------------------+--------------------+
| id                   | user_id              | factor_type         | created             | status             |
+----------------------+----------------------+---------------------+---------------------+--------------------+
| mbl1l5dh18Js2io3S5d7 | 00u1kcigdvWtR96HY5d7 | sms                 | 2021-08-27 10:03:19 | PENDING_ACTIVATION |
| ost1l5cklwIRvLzUY5d7 | 00u1kcigdvWtR96HY5d7 | token:software:totp | 2021-08-27 09:56:43 | ACTIVE             |
| uft1l5e40d7dkyGXM5d7 | 00u1kcigdvWtR96HY5d7 | token:software:totp | 2021-08-27 10:02:26 | ACTIVE             |
+----------------------+----------------------+---------------------+---------------------+--------------------+
> select
  id,
  user_id,
  factor_type,
  created,
  status
from
  okta_factor
where
  status = 'PENDING_ACTIVATION';
2021-09-01T22:09:31.522+0530 [TRACE] steampipe: executor in
2021-09-01T22:09:31.526+0530 [TRACE] steampipe: restartInteractiveSession
2021-09-01T22:09:31.526+0530 [TRACE] steampipe: Close prompt - then 1
2021-09-01T22:09:31.526+0530 [TRACE] steampipe: executor out
+----------------------+----------------------+-------------+---------------------+--------------------+
| id                   | user_id              | factor_type | created             | status             |
+----------------------+----------------------+-------------+---------------------+--------------------+
| mbl1l5dh18Js2io3S5d7 | 00u1kcigdvWtR96HY5d7 | sms         | 2021-08-27 10:03:19 | PENDING_ACTIVATION |
+----------------------+----------------------+-------------+---------------------+--------------------+
> select
  id,
  user_id,
  factor_type,
  created,
  provider,
  status
from
  okta_factor
where
  provider = 'OKTA';
2021-09-01T22:09:39.173+0530 [TRACE] steampipe: executor in
2021-09-01T22:09:39.175+0530 [TRACE] steampipe: restartInteractiveSession
2021-09-01T22:09:39.175+0530 [TRACE] steampipe: Close prompt - then 1
2021-09-01T22:09:39.175+0530 [TRACE] steampipe: executor out
+----------------------+----------------------+---------------------+---------------------+----------+--------------------+
| id                   | user_id              | factor_type         | created             | provider | status             |
+----------------------+----------------------+---------------------+---------------------+----------+--------------------+
| mbl1l5dh18Js2io3S5d7 | 00u1kcigdvWtR96HY5d7 | sms                 | 2021-08-27 10:03:19 | OKTA     | PENDING_ACTIVATION |
| ost1l5cklwIRvLzUY5d7 | 00u1kcigdvWtR96HY5d7 | token:software:totp | 2021-08-27 09:56:43 | OKTA     | ACTIVE             |
+----------------------+----------------------+---------------------+---------------------+----------+--------------------+
> select
  id,
  user_id,
  factor_type,
  created,
  status
from
  okta_factor
where
  id = 'ost1l5cklwIRvLzUY5d7' and user_id = '00u1kcigdvWtR96HY5d7';
2021-09-01T22:09:47.439+0530 [TRACE] steampipe: executor in
2021-09-01T22:09:47.806+0530 [TRACE] steampipe: restartInteractiveSession
2021-09-01T22:09:47.806+0530 [TRACE] steampipe: Close prompt - then 1
2021-09-01T22:09:47.806+0530 [TRACE] steampipe: executor out
+----------------------+----------------------+---------------------+---------------------+--------+
| id                   | user_id              | factor_type         | created             | status |
+----------------------+----------------------+---------------------+---------------------+--------+
| ost1l5cklwIRvLzUY5d7 | 00u1kcigdvWtR96HY5d7 | token:software:totp | 2021-08-27 09:56:43 | ACTIVE |
+----------------------+----------------------+---------------------+---------------------+--------+
> 

@c0d3r-arnab c0d3r-arnab self-assigned this Aug 30, 2021
@c0d3r-arnab c0d3r-arnab marked this pull request as ready for review August 31, 2021 08:14
@c0d3r-arnab c0d3r-arnab linked an issue Aug 31, 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


// JSON Columns
{Name: "embedded", Type: proto.ColumnType_JSON, Description: "The embedded properties of the factor .", Transform: transform.FromField("Factor.Embedded")},
{Name: "links", Type: proto.ColumnType_JSON, Description: "The link properties of the factor.", Transform: transform.FromField("Factor.Links")},
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 link properties of the factor.", Transform: transform.FromField("Factor.Links")},

Also update examples for same

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
Please update the code for scope to read okta factors in the private key authentication method

@c0d3r-arnab
Copy link
Contributor Author

c0d3r-arnab commented Sep 1, 2021

@c0d3r-arnab
Please update the code for scope to read okta factors in the private key authentication method

The query returns data without the private key authentication method:

select * from okta_private.okta_factor
2021-09-01T22:02:47.573+0530 [TRACE] steampipe: executor in
⠇ Loading results... 2021-09-01T22:02:50.407+0530 [TRACE] steampipe: restartInteractiveSession
2021-09-01T22:02:50.407+0530 [TRACE] steampipe: Close prompt - then 1
2021-09-01T22:02:50.407+0530 [TRACE] steampipe: executor out
+----------------------+----------------------+---------------------+---------------------+---------------------+----------+--------------------+----------+--------+----------------------+
| id                   | user_id              | factor_type         | created             | last_updated        | provider | status             | embedded | verify | title                |
+----------------------+----------------------+---------------------+---------------------+---------------------+----------+--------------------+----------+--------+----------------------+
| ost1l5cklwIRvLzUY5d7 | 00u1kcigdvWtR96HY5d7 | token:software:totp | 2021-08-27 09:56:43 | 2021-08-27 09:57:15 | OKTA     | ACTIVE             | <null>   | <null> | ost1l5cklwIRvLzUY5d7 |
| mbl1l5dh18Js2io3S5d7 | 00u1kcigdvWtR96HY5d7 | sms                 | 2021-08-27 10:03:19 | 2021-08-27 10:03:19 | OKTA     | PENDING_ACTIVATION | <null>   | <null> | mbl1l5dh18Js2io3S5d7 |
| uft1l5e40d7dkyGXM5d7 | 00u1kcigdvWtR96HY5d7 | token:software:totp | 2021-08-27 10:02:26 | 2021-08-27 10:02:55 | GOOGLE   | ACTIVE             | <null>   | <null> | uft1l5e40d7dkyGXM5d7 |
+----------------------+----------------------+---------------------+---------------------+---------------------+----------+--------------------+----------+--------+----------------------+

Columns: []*plugin.Column{
// Top Columns
{Name: "id", Type: proto.ColumnType_STRING, Description: "A unique key for the factor.", Transform: transform.FromField("Factor.Id")},
{Name: "user_id", Type: proto.ColumnType_STRING, Description: "A unique key for the user."},
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also bring users login name for an easier look up of the data

Copy link
Contributor

Choose a reason for hiding this comment

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

Added the user login name column

select * from okta_factor where id = 'ost1m64qvuJk6dICv5d7' and user_id = '00u1kcfw5yDiVG80P5d7';
+----------------------+----------------------+-------------------+---------------------+---------------------+---------------------+----------+--------------------+----------+--------+----------------------+
| id                   | user_id              | user_name         | factor_type         | created             | last_updated        | provider | status             | embedded | verify | title                |
+----------------------+----------------------+-------------------+---------------------+---------------------+---------------------+----------+--------------------+----------+--------+----------------------+
| ost1m64qvuJk6dICv5d7 | 00u1kcfw5yDiVG80P5d7 | partha@turbot.com | token:software:totp | 2021-08-30 12:53:16 | 2021-08-30 12:53:16 | OKTA     | PENDING_ACTIVATION | <null>   | <null> | ost1m64qvuJk6dICv5d7 |
+----------------------+----------------------+-------------------+---------------------+---------------------+---------------------+----------+--------------------+----------+--------+----------------------+

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 comment to add user login name field

@LalitLab LalitLab requested a review from ParthaI September 2, 2021 09:48
@LalitLab LalitLab changed the title Add table okta_factor Add table okta_factor. Closes #17 Sep 2, 2021
@LalitLab LalitLab merged commit e71de2c into main Sep 2, 2021
@LalitLab LalitLab deleted the issue-17 branch September 2, 2021 12:38
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_factor
3 participants