Commit 757b147

mo <mo@mokhan.ca>
2018-10-28 19:02:40
add post on oauth authorization server.
1 parent 0664daf
doc/_includes/curl.erb
@@ -2,7 +2,6 @@
 #### <%= interaction['request']['method'].upcase %> <%= interaction['request']['uri'].gsub(/\h{8}-\h{4}-\h{4}-\h{4}-\h{12}/, ':id') %>
 
 Example curl request:
-
 <% headers = interaction['request']['headers'].map { |(key, value)| "-H \"#{key}: #{value[0]}\"" } %>
 ```bash
 $ curl <%= interaction['request']['uri'] %> \
@@ -11,7 +10,6 @@ $ curl <%= interaction['request']['uri'] %> \
   <%= headers.join(" \\\n  ") %>
 ```
 Request Headers:
-
 <% headers = interaction['request']['headers'].map { |(key, value)| "#{key}: #{value[0]}" } %>
 ```text
 <%= headers.join("\n") %>
@@ -23,9 +21,7 @@ Request Body:
 <%= JSON.pretty_generate(json) %>
 ```
 <% end %>
-
 Response Headers:
-
 <% headers = interaction['response']['headers'].map { |(key, value)| "#{key}: #{value[0]}" } %>
 ```text
 <%= headers.join("\n") %>
@@ -33,7 +29,6 @@ Response Headers:
 <% json = JSON.parse(interaction['response']['body']['string']) rescue {} %>
 <% if json.present? %>
 Response Body:
-
 ```json
 <%= JSON.pretty_generate(json) %>
 ```
doc/_includes/get-well-known-oauth-authorization-server.html
@@ -0,0 +1,77 @@
+
+#### GET http://localhost:5000/.well-known/oauth-authorization-server
+
+Example curl request:
+
+```bash
+$ curl http://localhost:5000/.well-known/oauth-authorization-server \
+  -X GET \
+  -d '' \
+  -H "Accept: application/json" \
+  -H "Content-Type: application/json" \
+  -H "User-Agent: net/hippie 0.1.9" \
+  -H "Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
+```
+Request Headers:
+
+```text
+Accept: application/json
+Content-Type: application/json
+User-Agent: net/hippie 0.1.9
+Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
+```
+
+
+Response Headers:
+
+```text
+X-Frame-Options: SAMEORIGIN
+X-Xss-Protection: 1; mode=block
+X-Content-Type-Options: nosniff
+X-Download-Options: noopen
+X-Permitted-Cross-Domain-Policies: none
+Referrer-Policy: strict-origin-when-cross-origin
+Content-Type: application/json; charset=utf-8
+Etag: W/"7f1eee6ebfc3008c58d630548ed1707c"
+Cache-Control: max-age=0, private, must-revalidate
+Set-Cookie: _proof=e343785abce2b45b8b8e967aff136bea; path=/; HttpOnly
+X-Request-Id: 99feec7e-ced0-465f-aadc-3968a2f42ebb
+X-Runtime: 0.241107
+Transfer-Encoding: chunked
+```
+
+
+Response Body:
+```json
+{
+  "issuer": "http://localhost:5000/",
+  "authorization_endpoint": "http://localhost:5000/oauth/authorizations",
+  "token_endpoint": "http://localhost:5000/oauth/tokens",
+  "token_endpoint_auth_methods_supported": [
+    "client_secret_basic"
+  ],
+  "token_endpoint_auth_signing_alg_values_supported": [
+    "RS256"
+  ],
+  "userinfo_endpoint": "http://localhost:5000/oauth/me",
+  "jwks_uri": "",
+  "registration_endpoint": "http://localhost:5000/oauth/clients",
+  "scopes_supported": [
+
+  ],
+  "response_types_supported": [
+    "code",
+    "token"
+  ],
+  "service_documentation": "http://localhost:5000/doc",
+  "ui_locales_supported": [
+    "en",
+    "es",
+    "fr",
+    "ja",
+    "ko"
+  ]
+}
+```
+
+
doc/_posts/2018-10-28-oauth-metadata.markdown
@@ -0,0 +1,9 @@
+---
+layout: post
+title:  "OAuth 2.0 - Metadata"
+date:   2018-10-28 12:00:00 -0700
+permalink: /oauth/metadata.html
+categories: oauth
+---
+
+{% include get-well-known-oauth-authorization-server.html %}
spec/documentation.rb
@@ -9,6 +9,7 @@ RSpec.configure do |config|
   config.include FactoryBot::Syntax::Methods
   config.before :suite do
     FileUtils.rm_rf(Rails.root.join('doc/_cassettes/'))
+    Net::Hippie.logger = Logger.new('/dev/null')
     VCR.configure do |x|
       x.cassette_library_dir = "doc/_cassettes"
       x.hook_into :webmock