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

Support for OCI profiles. #5118

Merged
merged 6 commits into from
Jan 3, 2023
Merged

Support for OCI profiles. #5118

merged 6 commits into from
Jan 3, 2023

Conversation

sdedic
Copy link
Member

@sdedic sdedic commented Dec 16, 2022

The OCI config (~/.oci/config by default) may contain multiple profiles, each providing a different auth token (= different effective permissions) and/or connecting to a different tenancy in specific region. The current implementation assumed just the default profile for all operations.

I've changed the implementation so that:

  • adding a OCI cloud will allow the user to select from available profiles
  • a profile becomes "connected" - it gets a record in NB configuration and will display in the Services tree
  • the Services view honours different auth/region/tenancy settings for different profiles displayed.
  • all operations in Services view should now operate with the appropriate profile
  • one of the profiles is active, initially the default one. Active profile selection is preserved in settings.

It is possible to temporarily set an active profile; the settings will be eventually propagated through RequestProcessors tasks initiated by the wrapped execution.

ADM vulnerability scan features now accept profile to run with, and the relevant LSP audit command accepts an optional profile setting.

@sdedic sdedic added enhancement LSP [ci] enable Language Server Protocol tests enterprise [ci] enable enterprise job labels Dec 16, 2022
@sdedic sdedic added this to the NB17 milestone Dec 16, 2022
@sdedic sdedic requested a review from jhorvath December 16, 2022 21:22
@sdedic sdedic self-assigned this Dec 16, 2022
…g/netbeans/modules/nbcode/integration/commands/ProjectAuditCommand.java
Copy link
Contributor

@dbalek dbalek left a comment

Choose a reason for hiding this comment

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

Looks fine

@sdedic
Copy link
Member Author

sdedic commented Jan 3, 2023

Some more changes coming, sorry -- @jhorvath suggested offline that the tenancy name should be shown instead of region, asi it probably makes more sense to the user. The tenancy name however need to be fetched from the remote, since OCI profile only contains tenancy OCID

Copy link
Contributor

@jhorvath jhorvath left a comment

Choose a reason for hiding this comment

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

Looks good

JLabel l = (JLabel)c;
l.setIcon(ImageUtilities.loadImageIcon("org/netbeans/modules/cloud/oracle/resources/tenancy.svg", false));
if (p.isDefaultConfig()) {
l.setText(Bundle.LBL_DefaultConfigProfile(p.getId(), p.getConfigProvider().getRegion().getRegionId()));
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer tenancy name instead of default region here.

@sdedic sdedic merged commit 6e18d43 into apache:master Jan 3, 2023
@mbien
Copy link
Member

mbien commented Jan 3, 2023

looks like this one causes the VSCode ext job to fail. We should probably trigger that one with the LSP label too, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement enterprise [ci] enable enterprise job LSP [ci] enable Language Server Protocol tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants