Fix: ZTA typos (#2845)

This commit is contained in:
Cristine Guadelupe 2024-10-29 20:13:56 +08:00 committed by GitHub
parent 3c9fedbca5
commit 65027853c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -6,7 +6,7 @@ defmodule Livebook.ZTA.Cloudflare do
import Plug.Conn import Plug.Conn
@assertion "cf-access-jwt-assertion" @assertion "cf-access-jwt-assertion"
@renew_afer 24 * 60 * 60 * 1000 @renew_after 24 * 60 * 60 * 1000
@fields %{"user_uuid" => :id, "name" => :name, "email" => :email} @fields %{"user_uuid" => :id, "name" => :name, "email" => :email}
defstruct [:req_options, :identity, :name] defstruct [:req_options, :identity, :name]
@ -39,7 +39,7 @@ defmodule Livebook.ZTA.Cloudflare do
defp renew(state) do defp renew(state) do
Logger.debug("[#{inspect(__MODULE__)}] requesting #{inspect(state.req_options)}") Logger.debug("[#{inspect(__MODULE__)}] requesting #{inspect(state.req_options)}")
keys = Req.request!(state.req_options).body["keys"] keys = Req.request!(state.req_options).body["keys"]
Process.send_after(self(), :renew, @renew_afer) Process.send_after(self(), :renew, @renew_after)
Livebook.ZTA.put(state.name, {state.identity, keys}) Livebook.ZTA.put(state.name, {state.identity, keys})
state state
end end

View file

@ -6,7 +6,7 @@ defmodule Livebook.ZTA.GoogleIAP do
import Plug.Conn import Plug.Conn
@assertion "x-goog-iap-jwt-assertion" @assertion "x-goog-iap-jwt-assertion"
@renew_afer 24 * 60 * 60 * 1000 @renew_after 24 * 60 * 60 * 1000
@fields %{"sub" => :id, "name" => :name, "email" => :email} @fields %{"sub" => :id, "name" => :name, "email" => :email}
defstruct [:req_options, :identity, :name] defstruct [:req_options, :identity, :name]
@ -39,7 +39,7 @@ defmodule Livebook.ZTA.GoogleIAP do
defp renew(state) do defp renew(state) do
Logger.debug("[#{inspect(__MODULE__)}] requesting #{inspect(state.req_options)}") Logger.debug("[#{inspect(__MODULE__)}] requesting #{inspect(state.req_options)}")
keys = Req.request!(state.req_options).body["keys"] keys = Req.request!(state.req_options).body["keys"]
Process.send_after(self(), :renew, @renew_afer) Process.send_after(self(), :renew, @renew_after)
Livebook.ZTA.put(state.name, {state.identity, keys}) Livebook.ZTA.put(state.name, {state.identity, keys})
state state
end end