diff --git a/bin/webauthn_demo.ml b/bin/webauthn_demo.ml index 0a0ccf7..9512c97 100644 --- a/bin/webauthn_demo.ml +++ b/bin/webauthn_demo.ml @@ -178,8 +178,8 @@ let add_routes t = ] -let setup_app level port host application_id https = - let webauthn = Webauthn.create application_id in +let setup_app level port host origin https = + let webauthn = Webauthn.create origin in let level = match level with None -> None | Some Logs.Debug -> Some `Debug | Some Info -> Some `Info | Some Warning -> Some `Warning | Some Error -> Some `Error | Some App -> None in Dream.initialize_log ?level (); Dream.run ~port ~interface:host ~https @@ -199,16 +199,16 @@ let host = let doc = "host" in Arg.(value & opt string "0.0.0.0" & info [ "h"; "host" ] ~doc) -let application_id = - let doc = "the webauthn application id - usually protocol://host(:port)" in - Arg.(value & opt string "https://webauthn-demo.robur.coop" & info [ "application-id" ] ~doc) +let origin = + let doc = "the webauthn relying party origin - usually protocol://host" in + Arg.(value & opt string "https://webauthn-demo.robur.coop" & info [ "origin" ] ~doc) let tls = let doc = "tls" in Arg.(value & flag & info [ "tls" ] ~doc) let () = - let term = Term.(pure setup_app $ Logs_cli.level () $ port $ host $ application_id $ tls) in + let term = Term.(pure setup_app $ Logs_cli.level () $ port $ host $ origin $ tls) in let info = Term.info "Webauthn app" ~doc:"Webauthn app" ~man:[] in match Term.eval (term, info) with | `Ok () -> exit 0 diff --git a/src/webauthn.ml b/src/webauthn.ml index 4875566..7c1e972 100644 --- a/src/webauthn.ml +++ b/src/webauthn.ml @@ -225,6 +225,7 @@ let json_string thing : Yojson.Safe.t -> (string, _) result = function | `String s -> Ok s | json -> Error (`Json_decoding (thing, "non-string", Yojson.Safe.to_string json)) +(* XXX: verify [origin] is in fact an origin *) let create origin = { origin } let rpid t =