Request for greedy plug: certbot:plugin interface

Hello! As discussed here, the Certbot snap has an interface (certbot:plugin) that may be connected to multiple slots. The Certbot team publishes several first-party snaps that we’d like to auto-connect to that plug (our certbot-dns-* snaps). We’d like the plug in the Certbot snap to auto-connect to all matching slots in snaps published by us.

We also expect that third parties will create additional snaps that use that interface; those shouldn’t automatically connect.

I see the information page about greedy plugs here; is there specific information we can provide to help this get set up properly?

Thank you!

2 Likes

Any update on this? Do we need to write the declarations ourselves?

The declarations are written by the store team but first the @reviewers need to vote on this request, I think.

edit: looks like I don’t have the power to summon reviewers so @jdstrand will have to do, I guess.

1 Like

I’ve adjusted the reviewers settings so anyone can mention the team.

This requires something from me before the others vote. This is being tracked in our queue and will be addressed soon. Sorry for the delay.

2 Likes

Thank you, glad to hear it hasn’t gotten lost.

So sorry for the delay!

Since the request only changes the greediness of the auto-connection, and not cross-publisher connections, in the interest of time I simply granted this (@reviewers - please speak up if you feel this is in error).

I chose to use this for the plugs of the snap declaration:

{
  "content": {
    "allow-auto-connection": [
      {
        "plug-attributes": {
          "content": "certbot-1"
        },
        "slot-attributes": {
          "content": "$PLUG(content)"
        },
        "slots-per-plug": "*",
        "slot-publisher-id": [
          "$PLUG_PUBLISHER_ID"
        ]
      },
      {
        "plug-attributes": {
          "content": "$SLOT(content)"
        },
        "slot-publisher-id": [
          "$PLUG_PUBLISHER_ID"
        ]
      }
    ]
  }
}

This limits the greediness to the certbot snap’s content plug that uses content: certbot-1 with the idea that if you add another content plug, it will behave normally (ie, auto-connect if same publisher without greediness).

I tested this and after following the instructions in the other topic, everything seems to work:

Interface                 Plug                                       Slot                              Notes
content[metadata-1]       certbot-dns-digitalocean:certbot-metadata  certbot:certbot-metadata          -
content[metadata-1]       certbot-dns-luadns:certbot-metadata        certbot:certbot-metadata          -
content[certbot-1]        certbot:plugin                             certbot-dns-digitalocean:certbot  -
content[certbot-1]        certbot:plugin                             certbot-dns-luadns:certbot        -

Please test and let us know how it goes.

4 Likes

Just tested this myself and all looks good, thank you so much for doing this!

3 Likes

Awesome! :slight_smile: