fix(internal/jujuclient/applicationoffers.go): set user when getting offer consume details #1509
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When getting consume details for an application offer the juju controller will, among other things,
also return a macaroon that is passed to the consuming side. That macaroon contains a
third party caveat addressed to JIMM in which it instructs JIMM to verify that the user
is consumer of the application offer. Previously we were passing in an empty user tag
which meant that Juju added that 3rd party caveat for the authenticated user and since
JIMM always dials the juju controller as user
admin
that caveat was instructing JIMMto check that the
admin
user hasconsume
access to the application offer.This PR proposes one way to fix is, which is to specify the user when getting consume
details from the controller. The other way would be to dial the controller as the
logged-in user.
Description
Engineering checklist
Test instructions