Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Record details against relations to offers, eg username #7694
Conversation
babbageclunk
approved these changes
Aug 1, 2017
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
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
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.
|
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. |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
wallyworld commentedAug 1, 2017
•
Edited 1 time
-
wallyworld
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