Adapt terminology to WebAuthn
It is not called application id in WebAuthn
This commit is contained in:
parent
9837815a5a
commit
aa65c0546b
2 changed files with 7 additions and 6 deletions
|
@ -178,8 +178,8 @@ let add_routes t =
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
let setup_app level port host application_id https =
|
let setup_app level port host origin https =
|
||||||
let webauthn = Webauthn.create application_id in
|
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
|
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.initialize_log ?level ();
|
||||||
Dream.run ~port ~interface:host ~https
|
Dream.run ~port ~interface:host ~https
|
||||||
|
@ -199,16 +199,16 @@ let host =
|
||||||
let doc = "host" in
|
let doc = "host" in
|
||||||
Arg.(value & opt string "0.0.0.0" & info [ "h"; "host" ] ~doc)
|
Arg.(value & opt string "0.0.0.0" & info [ "h"; "host" ] ~doc)
|
||||||
|
|
||||||
let application_id =
|
let origin =
|
||||||
let doc = "the webauthn application id - usually protocol://host(:port)" in
|
let doc = "the webauthn relying party origin - usually protocol://host" in
|
||||||
Arg.(value & opt string "https://webauthn-demo.robur.coop" & info [ "application-id" ] ~doc)
|
Arg.(value & opt string "https://webauthn-demo.robur.coop" & info [ "origin" ] ~doc)
|
||||||
|
|
||||||
let tls =
|
let tls =
|
||||||
let doc = "tls" in
|
let doc = "tls" in
|
||||||
Arg.(value & flag & info [ "tls" ] ~doc)
|
Arg.(value & flag & info [ "tls" ] ~doc)
|
||||||
|
|
||||||
let () =
|
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
|
let info = Term.info "Webauthn app" ~doc:"Webauthn app" ~man:[] in
|
||||||
match Term.eval (term, info) with
|
match Term.eval (term, info) with
|
||||||
| `Ok () -> exit 0
|
| `Ok () -> exit 0
|
||||||
|
|
|
@ -225,6 +225,7 @@ let json_string thing : Yojson.Safe.t -> (string, _) result = function
|
||||||
| `String s -> Ok s
|
| `String s -> Ok s
|
||||||
| json -> Error (`Json_decoding (thing, "non-string", Yojson.Safe.to_string json))
|
| 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 create origin = { origin }
|
||||||
|
|
||||||
let rpid t =
|
let rpid t =
|
||||||
|
|
Loading…
Reference in a new issue