Record details against relations to offers, eg username #7694

Merged
merged 1 commit into from Aug 1, 2017

Conversation

Projects
None yet
3 participants
Owner

wallyworld commented Aug 1, 2017

Description of change

Introduce a new collection to hold details about connections to offers. There's a 1:1 between the relation and the offer connection records. For now we just store user name of the person making the connection.

The user name to store comes from the macaroon when the relation is registered, so extend the macaroon to add user name. Also add some missing tests.

The RemoteConnectionStatus logic is moved to use the new offers connection data.

As a driveby, fix the status message on remote applications so that only the offer side shows the "waiting for connections" message.

QA steps

Run up a cmr scenario - mediawiki -> mysql
juju offers on the mysql model shows connection count 1
add model, deploy mediawiki, relate to mysql offer
juju offers on the mysql model shows connection count 2
remove one of the mediawiki relations
juju offers on the mysql model shows connection count 1

Can you expand the description with a bit more detail? Why are you adding this? What will the information be used for? Other than that it looks good.

return nil, err
}
+ // The macaroon needs to be attenuated to a user.
+ username, ok := attr["username"]
@babbageclunk

babbageclunk Aug 1, 2017

Member

You can't do this in the required values because that can only check for a specific username, where you want just some username, is that right? And because the macaroon is made by the offering controller, there's no link between the user's name here and the user's name in the macaroon? (Just checking that I understand what's going on.)

@wallyworld

wallyworld Aug 1, 2017

Owner

All we are doing here is extracting the username which was attached to the macaroon when it was minted. This is used to populate the offer connection details so we know who created this relation. There will be a separate discharge done (eventually) to check that the username has permission to consume the offer. That check was done when the consume was first executed, but may have changed between then and now when the relation is set up.

Owner

wallyworld commented Aug 1, 2017

To answer the question, t will be used to populate status on the offering side to show who is connected to each offer and what endpoint they are connected to.

Owner

wallyworld commented Aug 1, 2017

$$merge$$

Contributor

jujubot commented Aug 1, 2017

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot jujubot merged commit 5446b64 into juju:develop Aug 1, 2017

1 check passed

github-check-merge-juju Use !!.*!! to request another build. IE, !!build!!, !!retry!!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment