-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
defmodule CA.EUDI do | ||
@moduledoc "CA/EUDI/OID4VC HTTPS/HTTP library." | ||
|
||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
defmodule CA.EUDI.Issuer do | ||
@moduledoc "EUDI/OID4VC Issuer server." | ||
@profiles [ "secp256k1", "secp384r1", "secp521r1" ] | ||
Check warning on line 3 in lib/eudi/issuer.ex GitHub Actions / build
|
||
@templates [ "ocsp", "ipsec", "bgp", "eap", "cap", "sip", "cmc", "scvp", "ssh", "tls" ] | ||
Check warning on line 4 in lib/eudi/issuer.ex GitHub Actions / build
|
||
@classes [ "ca", "ra", "server", "client", "human", "program" ] | ||
Check warning on line 5 in lib/eudi/issuer.ex GitHub Actions / build
|
||
|
||
use Plug.Router | ||
plug :match | ||
plug :dispatch | ||
plug Plug.Parsers, parsers: [:json], json_decoder: Jason | ||
|
||
def start_link(opt) do | ||
Bandit.start_link(opt) | ||
end | ||
|
||
def child_spec(opt) do | ||
%{ | ||
id: EUDI.Issuer, | ||
start: {CA.EUDI.Issuer, :start_link, [opt]}, | ||
type: :supervisor, | ||
restart: :permanent | ||
} | ||
end | ||
|
||
get "/jwks" do CA.EST.Get.get(conn, "EUDI", [], [], "JWKS") end | ||
get "/.well-known/openid-configuration" do CA.EST.Get.get(conn, "EUDI", [], [], "CONFIG") end | ||
get "/.well-known/openid-credential-issuer" do CA.EST.Get.get(conn, "EUDI", [], [], "ISSUE") end | ||
get "/.well-known/oauth-authorization-server" do CA.EST.Get.get(conn, "EUDI", [], [], "OAUTH") end | ||
get "/.well-known/jwt-vc-issuer" do CA.EST.Get.get(conn, "EUDI", [], [], "JWT") end | ||
get "/openid4vc/credentialOffer" do CA.EST.Get.get(conn, "EUDI", [], [], "OFFER") end | ||
post "/openid4vc/jwt/issue" do CA.EST.Get.get(conn, "EUDI", [], [], "JWT") end | ||
post "/openid4vc/sdjwt/issue" do CA.EST.Get.get(conn, "EUDI", [], [], "SDJWT") end | ||
post "/openid4vc/mdoc/issue" do CA.EST.Get.get(conn, "EUDI", [], [], "MDOC") end | ||
|
||
match _ do send_resp(conn, 404, "Please refer to https://authority.erp.uno for more information.\n") end | ||
def encode(x) do | ||
case Jason.encode(x) do | ||
{:ok, bin} -> bin | ||
{:error, _} -> "" | ||
end |> Jason.Formatter.pretty_print | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
defmodule CA.EUDI.Verifier do | ||
@moduledoc "EUDI/OID4VC Verifier." | ||
@profiles [ "secp256k1", "secp384r1", "secp521r1" ] | ||
Check warning on line 3 in lib/eudi/verifier.ex GitHub Actions / build
|
||
@templates [ "ocsp", "ipsec", "bgp", "eap", "cap", "sip", "cmc", "scvp", "ssh", "tls" ] | ||
Check warning on line 4 in lib/eudi/verifier.ex GitHub Actions / build
|
||
@classes [ "ca", "ra", "server", "client", "human", "program" ] | ||
Check warning on line 5 in lib/eudi/verifier.ex GitHub Actions / build
|
||
|
||
use Plug.Router | ||
plug :match | ||
plug :dispatch | ||
plug Plug.Parsers, parsers: [:json], json_decoder: Jason | ||
|
||
def start_link(opt) do | ||
Bandit.start_link(opt) | ||
end | ||
|
||
def child_spec(opt) do | ||
%{ | ||
id: EUDI.Verifier, | ||
start: {CA.EUDI.Verifier, :start_link, [opt]}, | ||
type: :supervisor, | ||
restart: :permanent | ||
} | ||
end | ||
|
||
get "/openid4vc/session/:id" do CA.EST.Get.get(conn, "EUDI", [], id, "SESSION") end | ||
get "/openid4vc/policy-list" do CA.EST.Get.get(conn, "EUDI", [], [], "POLICIES") end | ||
get "/openid4vc/pd/:id" do CA.EST.Get.get(conn, "EUDI", [], id, "PD") end | ||
get "/openid4vc/verify/:state" do CA.EST.Get.get(conn, "EUDI", [], state, "VERIFY") end | ||
get "/openid4vc/request/:id" do CA.EST.Get.get(conn, "EUDI", [], id, "REQ") end | ||
|
||
match _ do send_resp(conn, 404, "Please refer to https://authority.erp.uno for more information.\n") end | ||
def encode(x) do | ||
case Jason.encode(x) do | ||
{:ok, bin} -> bin | ||
{:error, _} -> "" | ||
end |> Jason.Formatter.pretty_print | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
defmodule CA.EUDI.Wallet do | ||
@moduledoc "EUDI/OID4VC Wallet web application server." | ||
@profiles [ "secp256k1", "secp384r1", "secp521r1" ] | ||
Check warning on line 3 in lib/eudi/wallet.ex GitHub Actions / build
|
||
@templates [ "ocsp", "ipsec", "bgp", "eap", "cap", "sip", "cmc", "scvp", "ssh", "tls" ] | ||
Check warning on line 4 in lib/eudi/wallet.ex GitHub Actions / build
|
||
@classes [ "ca", "ra", "server", "client", "human", "program" ] | ||
Check warning on line 5 in lib/eudi/wallet.ex GitHub Actions / build
|
||
|
||
use Plug.Router | ||
plug :match | ||
plug :dispatch | ||
plug Plug.Parsers, parsers: [:json], json_decoder: Jason | ||
|
||
def start_link(opt) do | ||
Bandit.start_link(opt) | ||
end | ||
|
||
def child_spec(opt) do | ||
%{ | ||
id: EUDI.Wallet, | ||
start: {CA.EUDI.Wallet, :start_link, [opt]}, | ||
type: :supervisor, | ||
restart: :permanent | ||
} | ||
end | ||
|
||
get "/wallets" do CA.EST.Get.get(conn, "EUDI", [], [], "WALLETS") end | ||
get "/wallets/:id/dids" do CA.EST.Get.get(conn, "EUDI", [], [], "DIDS") end | ||
get "/wallets/:id/keys" do CA.EST.Get.get(conn, "EUDI", [], [], "KEYS") end | ||
get "/wallets/:id/credentials" do CA.EST.Get.get(conn, "EUDI", [], [], "CREDS") end | ||
get "/wallets/:id/issuers" do CA.EST.Get.get(conn, "EUDI", [], [], "ISSUERS") end | ||
get "/wallets/:id/exchange" do CA.EST.Get.get(conn, "EUDI", [], [], "EXCHANGES") end | ||
get "/wallets/parseMDoc" do CA.EST.Get.get(conn, "EUDI", [], [], "MDOC") end | ||
|
||
match _ do send_resp(conn, 404, "Please refer to https://authority.erp.uno for more information.\n") end | ||
def encode(x) do | ||
case Jason.encode(x) do | ||
{:ok, bin} -> bin | ||
{:error, _} -> "" | ||
end |> Jason.Formatter.pretty_print | ||
end | ||
end |