diff options
| author | mo khan <mo@mokhan.ca> | 2025-05-29 11:42:22 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-05-29 11:42:22 -0600 |
| commit | f83a838b8093341bfd209f433b9799da835c2567 (patch) | |
| tree | 6d57380a420034cf02bc5ba02c1e6635aeced34a | |
| parent | bfa9bc16b120a3f4325e3f6bb8d4da667be546d1 (diff) | |
feat: start to stub out the metadata endpoint
| -rwxr-xr-x | bin/test | 18 | ||||
| -rw-r--r-- | public/metadata.json | 2 | ||||
| -rw-r--r-- | src/main.rs | 3 |
3 files changed, 23 insertions, 0 deletions
@@ -33,5 +33,23 @@ class ServerTest < Minitest::Test response = client.get(base_url + "/404") assert_equal "404", response.code end + + # /.well-known/oauth-authorization-server https://datatracker.ietf.org/doc/html/rfc8414#section-3.1 + def test_metadata + response = client.get(base_url + "/.well-known/oauth-authorization-server") + assert_equal "200", response.code + end + + # /token - Token endpoint https://datatracker.ietf.org/doc/html/rfc8693#section-2.3 + def test_token + end + + # /introspect - Token introspection https://datatracker.ietf.org/doc/html/rfc7662#section-2 + def test_introspect + end + + # /revoke - Token revocation # https://datatracker.ietf.org/doc/html/rfc7009#section-2.1 + def test_revoke + end end diff --git a/public/metadata.json b/public/metadata.json new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/public/metadata.json @@ -0,0 +1,2 @@ +{ +} diff --git a/src/main.rs b/src/main.rs index ee71aac..993d72b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,6 +21,9 @@ fn handle(mut stream: TcpStream) { let (status_line, filename) = match &request_line[..] { "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "./public/index.html"), + "GET /.well-known/oauth-authorization-server HTTP/1.1" => { + ("HTTP/1.1 200 OK", "./public/metadata.json") + } _ => ("HTTP/1.1 404 NOT FOUND", "./public/404.html"), }; |
