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

fix(authorization): canCreate should not return void #502

Merged
merged 3 commits into from
Nov 6, 2019

Conversation

AbdulRahmanAlHamali
Copy link
Contributor

Retrofit methods cannot have a void return type. We either need to provide a return type, or a callback. This fixes the following exception:

java.lang.IllegalArgumentException: FiatService.canCreate: Must have either a return type or Callback as last argument.

I also added canCreate to the path, because it makes more sense.

Copy link
Contributor

@ajordens ajordens left a comment

Choose a reason for hiding this comment

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

Argument /:userId/:resourceType/create makes sense to me.

Co-Authored-By: Cameron Fieber <cameron@fieber.ca>
@cfieber
Copy link
Contributor

cfieber commented Nov 5, 2019

I was wrong about not changing the URI - this is breaking since we always do always call fiat on CREATE (and the enable/disable flag is on the fiat side).

We should leave the URI as is, or if we want to migrate it to the new form we should maintain a request mapping in fiat for the old form for some period of time - otherwise we are stuck in the situation of breaking front50 until we deploy new fiat (and then breaking old front50 until we deploy new).

@AbdulRahmanAlHamali
Copy link
Contributor Author

The thing is, it is already broken in its current state, so if we sneak that change in, we won't break something that works

@cfieber
Copy link
Contributor

cfieber commented Nov 6, 2019

Ah you are right - good point. Gonna :shipit:

@cfieber cfieber added the ready to merge Approved and ready for merge label Nov 6, 2019
@cfieber cfieber merged commit d61aef0 into spinnaker:master Nov 6, 2019
@cfieber
Copy link
Contributor

cfieber commented Nov 6, 2019

@spinnakerbot cherry-pick 1.17

spinnakerbot pushed a commit that referenced this pull request Nov 6, 2019
Fixes Retrofit client for canCreate.

Modifies create check endpoint for consistency.
@spinnakerbot
Copy link
Contributor

Cherry pick successful: #504

ezimanyi pushed a commit that referenced this pull request Nov 6, 2019
Fixes Retrofit client for canCreate.

Modifies create check endpoint for consistency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Approved and ready for merge target-release/1.18
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants