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

feat(IAM Identity): add support for inactivity reports #181

Merged
merged 3 commits into from
Apr 6, 2022

Conversation

michaelbeck
Copy link
Contributor

PR summary

adding new endpoints: create report, get report
adding new optional query parameter include_activity for the existing get calls of apikey/serviceid/profile by id.

PR Checklist

Please make sure that your PR fulfills the following requirements:

  • The commit message follows the Angular Commit Message Guidelines.
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Current vs new behavior

users will now be able to generate report for inactive identities.
create report: will return a reference
get report: this will return a detailed report of inactive identities
existing get apikey/serviceid/profile by id will now include additional optional parameter include_activity
if include_activity is passed as true the response will include a new section activity with last authn time and count.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

grafik

@michaelbeck michaelbeck requested a review from padamstx March 31, 2022 13:10
@CLAassistant
Copy link

CLAassistant commented Mar 31, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@padamstx padamstx left a comment

Choose a reason for hiding this comment

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

Just had a couple comments to resolve before we merge...

type IamIdentityV1 struct {
Service *core.BaseService
}

// DefaultServiceURL is the default URL to make service requests to.
const DefaultServiceURL = "https://iam.cloud.ibm.com"
const DefaultServiceURL = "https://iam.test.cloud.ibm.com"
Copy link
Member

Choose a reason for hiding this comment

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

This indicates that you generated the code using the "test" version of the API definition. We should really be using the version that will be checked into the "production" branch. That version would (I assume) specify the prod endpoint URL.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, sorry this was by mistake

Reference: &reportId,
}

for {
Copy link
Member

Choose a reason for hiding this comment

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

It looks like the logic here (with the "infinite" for loop) is to invoke the operation until it returns a status code other than 204. How do we know when/if we'll ever get a non-204 status code back??? This almost seems like a "paginated" response but there's no pagination :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are generating a report and while report generation is in progress it returns a 204. At some point in time the report will be either complete (and thus return a 200) or failed and return an error. But I accept that we should have a defensive strategy and stop looping after a while. Will improve...

@padamstx padamstx self-assigned this Mar 31, 2022
@padamstx
Copy link
Member

@michaelbeck Could you please post a screenshot of the results when running the integration tests and examples?

@michaelbeck
Copy link
Contributor Author

michaelbeck commented Mar 31, 2022

@michaelbeck Could you please post a screenshot of the results when running the integration tests and examples?

You see the screenshot of the integration tests under "Other Information" Will add one for the examples...
Actually adding one for integration tests as well, as I changed the test code:
grafik

Here comes the examples (just copying the end of the test, as these are the only added test cases):
grafik

Copy link
Member

@padamstx padamstx left a comment

Choose a reason for hiding this comment

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

LGTM
I'll merge this in when the rest of the PRs are ready as well.

@padamstx padamstx changed the title Add support for IAM Identity inactivity reports feat(IAM Identity): add support for inactivity reports Apr 5, 2022
@padamstx padamstx merged commit b332e0e into main Apr 6, 2022
@padamstx padamstx deleted the iam-id-activity branch April 6, 2022 19:34
ibm-devx-sdk pushed a commit that referenced this pull request Apr 6, 2022
# [0.24.0](v0.23.0...v0.24.0) (2022-04-06)

### Features

* **IAM Identity:** add support for inactivity reports ([#181](#181)) ([b332e0e](b332e0e))
@ibm-devx-sdk
Copy link

🎉 This PR is included in version 0.24.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants