authproto 0.3.0.beta4 → 0.3.0.beta5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/README.md +474 -311
  4. data/examples/basic_webapp/Gemfile +14 -0
  5. data/examples/{confidential_client → basic_webapp}/Gemfile.lock +1 -1
  6. data/examples/basic_webapp/README.md +300 -0
  7. data/examples/basic_webapp/app.rb +351 -0
  8. data/examples/basic_webapp/config/oauth-client-metadata.localhost.json +11 -0
  9. data/examples/basic_webapp/public/styles.css +346 -0
  10. data/examples/basic_webapp/scripts/generate_keys.rb +35 -0
  11. data/examples/basic_webapp/views/authorized.erb +48 -0
  12. data/examples/basic_webapp/views/index.erb +48 -0
  13. data/examples/{confidential_client → basic_webapp}/views/layout.erb +2 -2
  14. data/examples/bookmarks/Gemfile +16 -0
  15. data/examples/bookmarks/Gemfile.lock +158 -0
  16. data/examples/bookmarks/README.md +170 -0
  17. data/examples/bookmarks/Rakefile +23 -0
  18. data/examples/bookmarks/app/account.rb +16 -0
  19. data/examples/bookmarks/app/bookmark.rb +89 -0
  20. data/examples/bookmarks/app/init.rb +26 -0
  21. data/examples/bookmarks/app/oauth.rb +43 -0
  22. data/examples/bookmarks/app/server.rb +184 -0
  23. data/examples/bookmarks/config/oauth-client-metadata.localhost.json +11 -0
  24. data/examples/bookmarks/config/oauth-client-metadata.production.json +19 -0
  25. data/examples/bookmarks/config.ru +5 -0
  26. data/examples/bookmarks/db/migrate/20261107004141_create_bookmarks.rb +27 -0
  27. data/examples/bookmarks/db/schema.rb +33 -0
  28. data/examples/bookmarks/public/styles.css +59 -0
  29. data/examples/bookmarks/scripts/generate_keys.rb +35 -0
  30. data/examples/bookmarks/views/bookmarks.erb +86 -0
  31. data/examples/bookmarks/views/index.erb +17 -0
  32. data/examples/bookmarks/views/layout.erb +20 -0
  33. data/examples/minisky_console/Gemfile.lock +2 -2
  34. data/examples/minisky_console/README.md +29 -25
  35. data/examples/minisky_console/app.rb +3 -3
  36. data/examples/minisky_console/localhost.rb +5 -7
  37. data/examples/minisky_console/production.rb +6 -8
  38. data/lib/authproto/client.rb +413 -126
  39. data/lib/authproto/configuration.rb +1 -1
  40. data/lib/authproto/dpop/client.rb +28 -25
  41. data/lib/authproto/dpop/key_set.rb +2 -0
  42. data/lib/authproto/dpop/nonce_manager.rb +23 -20
  43. data/lib/authproto/dpop/proof_generator.rb +6 -3
  44. data/lib/authproto/dpop/stored_nonce.rb +7 -5
  45. data/lib/authproto/dpop.rb +2 -0
  46. data/lib/authproto/encryption.rb +2 -0
  47. data/lib/authproto/http_client.rb +5 -5
  48. data/lib/authproto/http_helpers.rb +6 -0
  49. data/lib/authproto/metadata/authorization_server.rb +4 -3
  50. data/lib/authproto/metadata/client_metadata.rb +6 -2
  51. data/lib/authproto/metadata/resource_server.rb +4 -3
  52. data/lib/authproto/minisky.rb +120 -33
  53. data/lib/authproto/par/client.rb +4 -2
  54. data/lib/authproto/par/client_assertion.rb +4 -1
  55. data/lib/authproto/par/request.rb +2 -0
  56. data/lib/authproto/par/response.rb +2 -0
  57. data/lib/authproto/par.rb +2 -0
  58. data/lib/authproto/pkce.rb +2 -0
  59. data/lib/authproto/serialization/session.rb +2 -2
  60. data/lib/authproto/serialization/stored_nonce.rb +2 -2
  61. data/lib/authproto/state/session.rb +8 -41
  62. data/lib/authproto/state/session_info.rb +150 -0
  63. data/lib/authproto/state/session_manager.rb +18 -15
  64. data/lib/authproto/state.rb +3 -1
  65. data/lib/authproto/storage/interface.rb +10 -0
  66. data/lib/authproto/storage/key_builder.rb +3 -3
  67. data/lib/authproto/storage/memory.rb +24 -18
  68. data/lib/authproto/storage/sqlite.rb +14 -0
  69. data/lib/authproto/token/refresh.rb +2 -2
  70. data/lib/authproto/token/response.rb +2 -0
  71. data/lib/authproto/token/revocation.rb +4 -2
  72. data/lib/authproto/version.rb +1 -1
  73. data/lib/authproto.rb +6 -3
  74. data/sig/authproto/client.rbs +33 -10
  75. data/sig/authproto/dpop/client.rbs +9 -3
  76. data/sig/authproto/dpop/nonce_manager.rbs +6 -6
  77. data/sig/authproto/dpop/proof_generator.rbs +4 -4
  78. data/sig/authproto/dpop/stored_nonce.rbs +2 -2
  79. data/sig/authproto/http_client.rbs +23 -6
  80. data/sig/authproto/http_helpers.rbs +1 -0
  81. data/sig/authproto/metadata/authorization_server.rbs +3 -3
  82. data/sig/authproto/metadata/client_metadata.rbs +1 -1
  83. data/sig/authproto/metadata/resource_server.rbs +2 -2
  84. data/sig/authproto/minisky.rbs +57 -0
  85. data/sig/authproto/state/session.rbs +12 -6
  86. data/sig/authproto/state/session_info.rbs +23 -0
  87. data/sig/authproto/state/session_manager.rbs +7 -2
  88. data/sig/authproto/storage/interface.rbs +1 -0
  89. data/sig/authproto/storage/key_builder.rbs +1 -1
  90. data/sig/authproto/storage/memory.rbs +1 -1
  91. data/sig/authproto/storage/sqlite.rbs +1 -0
  92. data/sig/authproto/token/revocation.rbs +1 -0
  93. data/sig/authproto.rbs +3 -8
  94. metadata +37 -15
  95. data/examples/confidential_client/Gemfile +0 -14
  96. data/examples/confidential_client/README.md +0 -236
  97. data/examples/confidential_client/app.rb +0 -308
  98. data/examples/confidential_client/public/styles.css +0 -70
  99. data/examples/confidential_client/scripts/generate_keys.rb +0 -21
  100. data/examples/confidential_client/views/authorized.erb +0 -46
  101. data/examples/confidential_client/views/index.erb +0 -44
  102. data/sig/authproto/minisky_oauth.rbs +0 -27
  103. /data/examples/{confidential_client/config/oauth-client-metadata.example.json → basic_webapp/config/oauth-client-metadata.production.json} +0 -0
  104. /data/examples/{confidential_client → basic_webapp}/config.ru +0 -0
  105. /data/examples/{confidential_client → basic_webapp}/screenshots/screenshot-1-sign-in.png +0 -0
  106. /data/examples/{confidential_client → basic_webapp}/screenshots/screenshot-2-success.png +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3cb457c63a25d1d681d7b10e55ef9330f199a69dc4aec845198501654b847323
4
- data.tar.gz: afa3e52767ec444f00f08a0f99386d6c9f0399a93a089b601ffddafd08538d3e
3
+ metadata.gz: 523ee74d9fc689f65676a8d6d854e84d38d45f6f22a5e68698aab47b211c10f6
4
+ data.tar.gz: 2d4bb3f7a69d889273a662634c0e519c958c70d0fbd697428a3ae01006c7b339
5
5
  SHA512:
6
- metadata.gz: 68e8b5f15499e7e5310f80ae96af47ffe369eafb49513c48773b0e9a2bac8c4fb8a2b5b1f4064803052551d0897666ad9eebe27f7bc440f2255d20856ef6588a
7
- data.tar.gz: 302b8dad6e2669ebb4225c4373e024c3228d7f0f3c95a94cdee8edaf057a0c6e01006772ce3d7d170f8d4147ec063b63daa6603f96869c790123fc5d8a0c7300
6
+ metadata.gz: db169d4593069312d81e9d8fb866b41d973a7b2e74ca9ae75adcc829325ff0a2ed316c8ff92412311e9e841a575effafbcea1286a90fe50f4fc2292de0ceae35
7
+ data.tar.gz: 9e0c2752138dbb31ca634d4b3715702cb02405cb3ef12b1d90bed3ef52387c990617be70fd7d88b66980d560fdfce8dd7df9de273fb7ee27ce5ae37c39ece6a1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ ## [0.3.0.beta5] – 2026-11-10
2
+
3
+ - added `process_dpop`, `has_nonce_error?` and `with_nonce_handling` helpers to `Client`, proxying the calls to `dpop_client` for easier access
4
+ - added `Client#http` which lets you access the global HTTP client
5
+ - added `Client.for_localhost` and `Minisky::OAuthClient.for_localhost` for creating a localhost client with metadata encoded in the `client_id` query params
6
+ - added `Client.localhost_app?` helper for checking a client ID
7
+ - added `Minisky::OAuthClient.with_oauth_client` to reuse an existing `AuthProto::Client` instead of creating a new one
8
+ - added `Minisky::OAuthClient#did`
9
+ - renamed `server_url` params to `url` in `Client`, `DPoP::Client` and `DPoP::NonceManager` and to `origin` in `StoredNonce`
10
+ - `Client` now rejects a `metadata` hash passed in argument for localhost clients (since you need to put the values into the `client_id` query params anyway for the server to read them)
11
+ - `Client#handle_callback` now takes the callback parameters as a single Hash parameter instead of keyword args
12
+ - `Client` methods that returned a session data hash, return the data now as a `SessionInfo` object
13
+ - replaced `Client#get_tokens` with `#get_session`; it now returns a session also if it's pending or has an expired access token
14
+ - removed `Client#dpop_client` from public API
15
+ - removed `#granted_scope`, `#has_limited_scope?` and `#authorized?` from `Session`
16
+ - `uri:` and `url:` arguments across the project now accept also `URI` objects
17
+ - response hashes are now accepted also having status code as a String and header values as array, so you can now pass e.g. a `Net::HTTPResponse` as: `{ status: res.code, headers: res.to_hash, body: res.body }`
18
+ - `Minisky::OAuthClient` doesn't require a PDS hostname anymore to create an instance
19
+ - renamed `Minisky::OAuthClient` to `Minisky::OAuth`
20
+ - added `AuthProto.storage.cleanup_expired_records`
21
+
1
22
  ## [0.3.0.beta4] – 2026-11-03
2
23
 
3
24
  - at the end of authentication that started with a PDS URL, verify that the received DID belongs to that PDS