Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow overriding tunnel server protocol/domain for caBLE #295

Merged
merged 7 commits into from
Apr 16, 2023

Conversation

micolous
Copy link
Collaborator

@micolous micolous commented Mar 29, 2023

This adds a cable-override-tunnel feature.

This allows the library to override which caBLE tunnel server protocol and domain it connects to, rather than the actual tunnel server. This is useful for testing #291 (caBLE tunnel server implementation), so one can run a tunnel server locally without needing to set up DNS and certificates.

Example

To act as an initiator overriding the tunnel server to be at ws://localhost:8080:

cargo run \
  --example authenticate \
  --features cable,cable-override-tunnel \
  -- \
  cable --tunnel-uri ws://localhost:8080

To act as an authenticator in the same way:

cargo run \
  --example cable_tunnel \
  --features cable,cable-override-tunnel \
  -- \
  --serial-port /dev/tty.usbmodem \
  --softtoken-path /tmp/softtoken.dat \
  --qr-image ~/Desktop/screenshot.png \
  --tunnel-uri ws://localhost:8080

Changes

Related fixing (which blocked this change):

  • only run doctest for features that are enabled

Public API changes:

  • share_cable_authenticator()'s parameters changed:

    • added options: ShareCableAuthenticatorOptions parameter
    • tunnel_server_id argument moved to ShareCableAuthenticatorOptions
    • close_after_one_command argument inverted to stay_open_after_one_command, and moved to ShareCableAuthenticatorOptions
    • added tunnel_uri field to ShareCableAuthenticatorOptions
  • Added connect_cable_authenticator_with_tunnel_uri method for new feature.

    This will probably be changed to use a ConnectCableAuthenticatorOptions struct like ShareCableAuthenticatorOptions once there's something else to put in there.

Internal API changes:

  • Eid::get_domain replaced with Eid::get_domain_builder
  • Eid::get_connect_uri now (internally) public
  • Added Eid::build_connect_uri (internally public)
  • Added Discovery::build_new_tunnel_uri (internally public)
  • Discovery::get_connect_uri removed (use Eid::get_connect_uri instead)
  • Added uri parameter to Tunnel::connect_authenticator
  • cargo test has been run and passes
  • documentation has been updated with relevant examples (if relevant)

@micolous micolous force-pushed the cable-localhost-tunnel branch 3 times, most recently from f3fa8df to 85e1b8e Compare March 29, 2023 23:54
@micolous micolous changed the title Cable localhost tunnel caBLE localhost tunnel Mar 29, 2023
@micolous micolous added enhancement New feature or request cable Issues relating to caBLE (Cloud-assisted Bluetooth Low Energy authenticators) labels Mar 29, 2023
This was referenced Mar 29, 2023
@micolous micolous force-pushed the cable-localhost-tunnel branch 2 times, most recently from d78132d to 18cde7e Compare March 30, 2023 06:20
@micolous micolous marked this pull request as ready for review March 30, 2023 23:49
@micolous micolous marked this pull request as draft April 8, 2023 06:19
Firstyear
Firstyear previously approved these changes Apr 11, 2023
@micolous micolous changed the title caBLE localhost tunnel Allow overriding tunnel server protocol/domain for caBLE Apr 12, 2023
@micolous micolous marked this pull request as ready for review April 13, 2023 04:34
@micolous micolous requested a review from Firstyear April 13, 2023 04:34
@yaleman yaleman merged commit 8619cfd into kanidm:master Apr 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cable Issues relating to caBLE (Cloud-assisted Bluetooth Low Energy authenticators) enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants