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

[8.x](backport #41044) x-pack/filebeat/input/entityanalytics/okta/internal: add role and factor client calls #41251

Open
wants to merge 2 commits into
base: 8.x
Choose a base branch
from

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Oct 16, 2024

Proposed commit message

See title.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

Author's Checklist

  • [ ]

How to test this PR locally

Requires an okta account to test. See header of test file for details.

Example redacted output excerpts from a test run:

=== RUN   Test/none/my_roles
{"log.level":"debug","@timestamp":"2024-09-30T08:28:17.132+0930","log.origin":{"function":"github.com/elastic/beats/v7/x-pack/filebeat/input/entityanalytics/provider/okta/internal/okta.getDetails[...]","file.name":"okta/okta.go","file.line":373},"message":"rate limit","limit":0.8323699233704588,"burst":1,"url":"https://REDACTEDADMINDOMAIN.okta.com/api/v1/users/REDACTEDUSER/roles","ecs.version":"1.6.0"}
{"log.level":"debug","@timestamp":"2024-09-30T08:28:18.357+0930","log.origin":{"function":"github.com/elastic/beats/v7/x-pack/filebeat/input/entityanalytics/provider/okta/internal/okta.oktaRateLimit","file.name":"okta/okta.go","file.line":453},"message":"rate limit header","X-Rate-Limit-Limit":"50","X-Rate-Limit-Remaining":"48","X-Rate-Limit-Reset":"1727650756","ecs.version":"1.6.0"}
{"log.level":"debug","@timestamp":"2024-09-30T08:28:18.357+0930","log.origin":{"function":"github.com/elastic/beats/v7/x-pack/filebeat/input/entityanalytics/provider/okta/internal/okta.oktaRateLimit","file.name":"okta/okta.go","file.line":495},"message":"rate limit adjust","set_rate":0.8327158626376382,"set_burst":1,"ecs.version":"1.6.0"}
    okta_test.go:141: roles: [{"id":"REDACTEDROLE","label":"Super Administrator","type":"SUPER_ADMIN","status":"ACTIVE","created":"REDACTEDDATE","lastUpdated":"2024-05-13T20:57:13Z","assignmentType":"USER","_links":{"assignee":{"href":"https://REDACTEDDOMAIN.okta.com/api/v1/users/REDACTEDUSER"}}}]

=== RUN   Test/none/my_factors
{"log.level":"debug","@timestamp":"2024-09-30T08:28:18.357+0930","log.origin":{"function":"github.com/elastic/beats/v7/x-pack/filebeat/input/entityanalytics/provider/okta/internal/okta.getDetails[...]","file.name":"okta/okta.go","file.line":373},"message":"rate limit","limit":0.8327158626376382,"burst":1,"url":"https://REDACTEDADMINDOMAIN.okta.com/api/v1/users/REDACTEDUSER/factors","ecs.version":"1.6.0"}
{"log.level":"debug","@timestamp":"2024-09-30T08:28:19.483+0930","log.origin":{"function":"github.com/elastic/beats/v7/x-pack/filebeat/input/entityanalytics/provider/okta/internal/okta.oktaRateLimit","file.name":"okta/okta.go","file.line":453},"message":"rate limit header","X-Rate-Limit-Limit":"50","X-Rate-Limit-Remaining":"47","X-Rate-Limit-Reset":"1727650756","ecs.version":"1.6.0"}
{"log.level":"debug","@timestamp":"2024-09-30T08:28:19.483+0930","log.origin":{"function":"github.com/elastic/beats/v7/x-pack/filebeat/input/entityanalytics/provider/okta/internal/okta.oktaRateLimit","file.name":"okta/okta.go","file.line":495},"message":"rate limit adjust","set_rate":0.8316150651486308,"set_burst":1,"ecs.version":"1.6.0"}
    okta_test.go:166: factors: [{"id":"REDACTEDFACTOR","factorType":"token:software:totp","provider":"OKTA","vendorName":"OKTA","status":"ACTIVE","created":"REDACTEDDATE","lastUpdated":"REDACTEDDATE","profile":{"credentialId":"REDACTEDLOGINID"},"_links":{"self":{"hints":{"allow":["GET","DELETE"]},"href":"https://REDACTEDDOMAIN.okta.com/api/v1/users/REDACTEDUSER/factors/REDACTEDFACTOR"},"user":{"hints":{"allow":["GET"]},"href":"https://REDACTEDDOMAIN.okta.com/api/v1/users/REDACTEDUSER"},"verify":{"hints":{"allow":["POST"]},"href":"https://REDACTEDDOMAIN.okta.com/api/v1/users/REDACTEDUSER/factors/REDACTEDFACTOR/verify"}}}]

Related issues

Use cases

Screenshots

Logs


This is an automatic backport of pull request #41044 done by [Mergify](https://mergify.com).

@mergify mergify bot requested a review from a team as a code owner October 16, 2024 06:26
@mergify mergify bot added the backport label Oct 16, 2024
@mergify mergify bot assigned efd6 Oct 16, 2024
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Oct 16, 2024
@botelastic
Copy link

botelastic bot commented Oct 16, 2024

This pull request doesn't have a Team:<team> label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants