atproto_auth 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +17 -2
  3. data/CHANGELOG.md +23 -2
  4. data/PROJECT_STRUCTURE.txt +10129 -0
  5. data/README.md +88 -2
  6. data/examples/confidential_client/.gitignore +2 -0
  7. data/examples/confidential_client/Gemfile.lock +6 -0
  8. data/examples/confidential_client/README.md +86 -9
  9. data/examples/confidential_client/app.rb +83 -12
  10. data/examples/confidential_client/{public/client-metadata.json → config/client-metadata.example.json} +5 -4
  11. data/examples/confidential_client/screenshots/screenshot-1-sign-in.png +0 -0
  12. data/examples/confidential_client/screenshots/screenshot-2-success.png +0 -0
  13. data/examples/confidential_client/scripts/generate_keys.rb +0 -0
  14. data/examples/confidential_client/views/authorized.erb +1 -1
  15. data/lib/atproto_auth/client.rb +98 -38
  16. data/lib/atproto_auth/client_metadata.rb +2 -2
  17. data/lib/atproto_auth/configuration.rb +35 -1
  18. data/lib/atproto_auth/dpop/key_manager.rb +1 -1
  19. data/lib/atproto_auth/dpop/nonce_manager.rb +30 -47
  20. data/lib/atproto_auth/encryption.rb +156 -0
  21. data/lib/atproto_auth/http_client.rb +2 -2
  22. data/lib/atproto_auth/identity/document.rb +1 -1
  23. data/lib/atproto_auth/identity/resolver.rb +1 -1
  24. data/lib/atproto_auth/serialization/base.rb +189 -0
  25. data/lib/atproto_auth/serialization/dpop_key.rb +29 -0
  26. data/lib/atproto_auth/serialization/session.rb +77 -0
  27. data/lib/atproto_auth/serialization/stored_nonce.rb +37 -0
  28. data/lib/atproto_auth/serialization/token_set.rb +43 -0
  29. data/lib/atproto_auth/server_metadata/authorization_server.rb +20 -1
  30. data/lib/atproto_auth/state/session_manager.rb +67 -20
  31. data/lib/atproto_auth/storage/interface.rb +112 -0
  32. data/lib/atproto_auth/storage/key_builder.rb +39 -0
  33. data/lib/atproto_auth/storage/memory.rb +191 -0
  34. data/lib/atproto_auth/storage/redis.rb +119 -0
  35. data/lib/atproto_auth/token/refresh.rb +249 -0
  36. data/lib/atproto_auth/version.rb +1 -1
  37. data/lib/atproto_auth.rb +29 -1
  38. metadata +32 -4
  39. data/examples/confidential_client/config/client-metadata.json +0 -25
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 32471644f76751fd94dd3e7ede93e8b88c43494a23afa6b5d48196163d2d427c
4
- data.tar.gz: 3a92957c782c800c23be621be8ecf85da19c4f3b2145705d79d3b8a9ac898d73
3
+ metadata.gz: 33b01bf6cb6fe8a7c1fcc3b48fad2be7d0b8e5f9f1e63d7107cfa77806859417
4
+ data.tar.gz: 15619a2a5ae61f36b9697dbf338df36e384c1c47caebf6c6a3e928fcd8fcd1a4
5
5
  SHA512:
6
- metadata.gz: b19ee50bae30ffba5a45deea718a7587c2db0c02a0f9ead117d2750e87943473ba8758c72fe5f8246d1499cd67bd2996d38f6144396130fd55252fb0e3acf5f8
7
- data.tar.gz: a0f12a5e81da053323fd2712f21626bb6e719b45282a26039c480d37bce652998d0180b96c47751c4245792cbdaed8a8f02798790042b6eb50ea9e14feb158b6
6
+ metadata.gz: 36067fee1cfcf45391d68d57f66fd4424c9b0a44963280bc155a4e5c5ce5f66ecbb88a4794f20cb3982799211685cd2278cb1c8170d1bfbecb541fc4a0a91627
7
+ data.tar.gz: 299121d8d81833fc543e8c633f767ecc3490745207dc73fa870c8c0e55797e53d20234d6f376c6e6eb13e00155584c61004f63ebc132f8f8a3db9041b633b4ef
data/.rubocop.yml CHANGED
@@ -3,11 +3,26 @@ AllCops:
3
3
  SuggestExtensions: false
4
4
  TargetRubyVersion: 3.0
5
5
 
6
+ Metrics/BlockLength:
7
+ Enabled: false
8
+
6
9
  Metrics/ClassLength:
7
- Max: 500
10
+ Enabled: false
11
+
12
+ Metrics/ModuleLength:
13
+ Enabled: false
8
14
 
9
15
  Metrics/MethodLength:
10
- Max: 50
16
+ Enabled: false
17
+
18
+ Metrics/AbcSize:
19
+ Enabled: false
20
+
21
+ Metrics/PerceivedComplexity:
22
+ Enabled: false
23
+
24
+ Metrics/CyclomaticComplexity:
25
+ Enabled: false
11
26
 
12
27
  Style/StringLiterals:
13
28
  EnforcedStyle: double_quotes
data/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
- ## [Unreleased]
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
2
3
 
3
- ## [0.1.0] - 2024-12-02
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [0.1.0] - 2024-12-07
8
+
9
+ ### Added
10
+ - Configurable storage backend system for managing OAuth state
11
+ - In-memory storage implementation included by default
12
+ - Redis storage implementation for production environments
13
+ - Thread-safe storage operations with atomic locks
14
+ - Storage encryption for sensitive data
15
+ - Automatic cleanup of expired tokens and session data
16
+ - Storage interface for custom backend implementations
17
+
18
+ ### Changed
19
+ - Storage configuration is now required in AtprotoAuth.configure
20
+ - Default configuration uses thread-safe in-memory storage
21
+ - Session and token management now use configured storage backend
22
+ - Improved thread safety for all storage operations
23
+
24
+ ## [0.0.1] - 2024-12-05
4
25
 
5
26
  - Initial release