Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
many: selectively swap semantics of plugs and slots #580
Conversation
zyga
added some commits
Mar 4, 2016
stevenwilkin
reviewed
Mar 4, 2016
| - // SlotSecuritySnippet returns the configuration snippet needed by the | ||
| - // given security system to allow a snap to use a plug of this interface. | ||
| + // PlugSecuritySnippet returns the configuration snippet needed by the | ||
| + // given security system to allow a snap to use a slot of this interface. | ||
| // | ||
| // An empty snippet is returned when the plug doesn't require anything | ||
| // from the security system to work, in addition to the default | ||
| // configuration. ErrUnknownSecurity is returned when the plug cannot | ||
| // deal with the requested security system. |
zyga
Mar 4, 2016
Contributor
This is confusingly correct IMHO. I re-wrote that paragraph to be much less confusing in the upcoming static security snippets branch.
Here both sides talk about a slot because you "consume a slot" or "provide a slot" and this is exactly what those bits were initially meant to do. I'd ignore it and review the wording on the static/dynamic branch
stevenwilkin
reviewed
Mar 4, 2016
| // Symbolic link traversal is handled correctly | ||
| builtin.MockEvalSymlinks(&s.BaseTest, func(path string) (string, error) { | ||
| return "", fmt.Errorf("broken symbolic link") | ||
| }) | ||
| - snippet, err := s.iface.SlotSecuritySnippet(s.gpioPlug, s.slot, interfaces.SecurityAppArmor) | ||
| + snippet, err := s.iface.PlugSecuritySnippet(s.gpioPlug, s.slot, interfaces.SecurityAppArmor) | ||
| c.Assert(err, ErrorMatches, "cannot compute slot security snippet: broken symbolic link") |
stevenwilkin
reviewed
Mar 4, 2016
| - "plugs": {{"snap": "canonical-pi2", "plug": "pin-13"}}, | ||
| - "slots": {{"snap": "keyboard-lights", "slot": "capslock-led"}} | ||
| + "slots": {{"snap": "canonical-pi2", "plug": "pin-13"}}, | ||
| + "plugs": {{"snap": "keyboard-lights", "slot": "capslock-led"}} |
zyga
closed this
Mar 4, 2016
|
Closing for now to do remaining changes |
zyga
added some commits
Mar 4, 2016
zyga
reopened this
Mar 4, 2016
niemeyer
reviewed
Mar 4, 2016
| $ snap interfaces --i=<interface> [<snap>] | ||
| -Lists only plugs and slots of the specific interface. | ||
| +Lists only slots and plugs of the specific interface. |
niemeyer
Mar 4, 2016
Contributor
Can you please replace this whole text by what's in the spec, just swapping plugs and slots?
It's much easier to understand than what's here.
|
LGTM, one comment. Thanks! |
added a commit
that referenced
this pull request
Mar 4, 2016
zyga
merged commit 89d999c
into
snapcore:master
Mar 4, 2016
zyga
referenced this pull request
Mar 4, 2016
Closed
many: rename Slot->Plug and Plug->Slot (as suggested by Gustavo) #577
zyga
deleted the
zyga:secafretni
branch
Mar 8, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
zyga commentedMar 4, 2016
This branch swaps Plugs and Slots around. Unlike a naive approach that would do this globally, the change is applied only to specific places because, ironically, some places already had the "plug connects to slot" order without us noticing.
Most notably the
snappypackage now appliesold-securityon theplug(not on the slot). In theclientandinterfaces`` package only comments are moved around since the representation of both types was symmetrical.The biggest change was in the
snap interfacescommand where the order of displaying the elements was fully swapped so that the slot side is printed in the first column and all the plugs are printed in the second column.For reference, "old-security" interface has to be specified under plugs now.