Skip to content

Add new sdk about generate authkeys #39

Description

@kerthcet

What would you like to be added:

Right now, for a controller, if it wants to connect to the daemons, it need to join the tailnet first which requires an authkey, you need to run something like:

              broker = os.environ["SANDD_KEYBROKER_URL"].rstrip("/")
              req = urllib.request.Request(f"{broker}/keys?kind=controller", method="POST")
              with urllib.request.urlopen(req, timeout=10) as resp:
                  authkey = json.load(resp)["key"]
              print("controller: minted key, joining mesh", flush=True)

              server = Server(connect="tunnel", tunnel_config=TunnelConfig(
                  authkey=authkey, server=os.environ["SANDD_TUNNEL_SERVER"]))
              print("controller: ready, waiting for daemons", flush=True)

Let's make them part of the python sdk, it would be easier then. You need to set the envs like:

            - name: SANDD_TUNNEL_SERVER
              value: http://nebula-headscale.nebula-system
            - name: SANDD_KEYBROKER_URL
              value: http://nebula-keybroker.nebula-system:8090

Why is this needed:

Completion requirements:

This feature requires the following artifacts:

  • Design doc
  • API change
  • Docs update

The artifacts should be linked in subsequent comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureCategorizes issue or PR as related to a new feature.needs-priorityIndicates a PR lacks a label and requires one.needs-triageIndicates an issue or PR lacks a label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions