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(core): Update account management API #5666

Merged
merged 4 commits into from
Mar 23, 2022

Conversation

jvz
Copy link
Contributor

@jvz jvz commented Mar 17, 2022

This refactors some things in preparation for user secrets support along with updating the type discriminator handling for account definitions.

These changes are independent of spinnaker/fiat#928 and spinnaker/kork#942, and I've noted TODO comments on where relevant updates related to those PRs will be added (with additional tests).

@spinnakerbot
Copy link
Contributor

The following commits need their title changed:

  • a40f8ac: Extract AccountDefinitionService class

Please format your commit title into the form:

<type>(<scope>): <subject>, e.g. fix(kubernetes): address NPE in status check

This allows us to easily generate changelogs & determine semantic version numbers when cutting releases. You can read more about commit conventions here.

@jvz
Copy link
Contributor Author

jvz commented Mar 17, 2022

Yeah yeah yeah, bot, I'll be squashing this PR into one commit. As for the test failure, this is strange as I didn't get that locally. I'm not sure how that happened :/

Copy link
Contributor

@german-muzquiz german-muzquiz left a comment

Choose a reason for hiding this comment

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

Integration tests are failing because of a dependency version mismatch for io.zipkin.brave:brace-instrumentation-http: some part of the code is using version 5.12.3 and other part is using 5.10.1. Not sure if this is a result of the recent version bump (and then revert) of spring boot: spinnaker/kork#941
cc @dbyron-sf

return true;
}
var userRoles = authorizer.getRoles(username);
if (userRoles.isEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if Spinnaker doesn't have authn or authz enabled? As I understand, userRoles will be empty and this method returns false. Does that have unwanted side effects?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If Fiat is disabled, isAdmin returns true, so this code doesn't get executed. Good catch, though!

@dbyron-sf
Copy link
Contributor

Integration tests are failing because of a dependency version mismatch for io.zipkin.brave:brace-instrumentation-http: some part of the code is using version 5.12.3 and other part is using 5.10.1. Not sure if this is a result of the recent version bump (and then revert) of spring boot: spinnaker/kork#941 cc @dbyron-sf

@j-sandy is working on a fix for the brave version. More details here, but I expect a fix to come in kork. Moving to enforcedPlatform (e.g. here in igor) is what started the struggles.

Copy link
Contributor

@german-muzquiz german-muzquiz 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 to me

@dbyron-sf
Copy link
Contributor

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Mar 23, 2022

update

✅ Branch has been successfully updated

@dbyron-sf
Copy link
Contributor

Hey @jvz did you mention some deck changes that go along with changing the type discriminator? Or is it that deck works better but there aren't any changes?

@jvz
Copy link
Contributor Author

jvz commented Mar 23, 2022

I said I changed the type discriminator in this PR which goes with the Gate PR, and it now matches how the existing type discriminator works in Deck (no changes to be made there).

@jvz jvz force-pushed the accounts-updates branch from b52f044 to 412b223 Compare March 23, 2022 21:03
jvz added 3 commits March 23, 2022 16:05
This refactors some things in preparation for user secrets support along with updating the type discriminator handling for account definitions.
@jvz jvz force-pushed the accounts-updates branch from 412b223 to 13a790b Compare March 23, 2022 21:05
@ConditionalOnMissingBean
public AccountDefinitionAuthorizer accountDefinitionAuthorizer(
Optional<FiatPermissionEvaluator> maybePermissionEvaluator,
@Value("${services.fiat.enabled:false}") boolean isFiatEnabled) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd love to pass a configuration object here instead of @Value but I'm not sure such an object exists today...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, there's the object where the evaluator comes from, but that wasn't enough of a hint here.

@dbyron-sf dbyron-sf added the ready to merge Approved and ready for a merge label Mar 23, 2022
@mergify mergify bot added the auto merged Merged automatically by a bot label Mar 23, 2022
@mergify mergify bot merged commit da65715 into spinnaker:master Mar 23, 2022
@jvz jvz deleted the accounts-updates branch June 6, 2022 22:22
nhtzr pushed a commit to armory/clouddriver that referenced this pull request Aug 17, 2022
* Extract AccountDefinitionService class

* feat(core): Update account management API

This refactors some things in preparation for user secrets support along with updating the type discriminator handling for account definitions.

* fix(test): Ensure Fiat is enabled with bean

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
nhtzr pushed a commit to armory/clouddriver that referenced this pull request Aug 18, 2022
* Extract AccountDefinitionService class

* feat(core): Update account management API

This refactors some things in preparation for user secrets support along with updating the type discriminator handling for account definitions.

* fix(test): Ensure Fiat is enabled with bean

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
nhtzr pushed a commit to armory/clouddriver that referenced this pull request Aug 18, 2022
* Extract AccountDefinitionService class

* feat(core): Update account management API

This refactors some things in preparation for user secrets support along with updating the type discriminator handling for account definitions.

* fix(test): Ensure Fiat is enabled with bean

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto merged Merged automatically by a bot ready to merge Approved and ready for a merge target-release/1.28
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants