token_authority 0.1.0 → 0.2.0

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 (61) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/README.md +199 -7
  4. data/app/controllers/concerns/token_authority/client_authentication.rb +141 -0
  5. data/app/controllers/concerns/token_authority/controller_event_logging.rb +98 -0
  6. data/app/controllers/concerns/token_authority/initial_access_token_authentication.rb +35 -0
  7. data/app/controllers/concerns/token_authority/token_authentication.rb +128 -0
  8. data/app/controllers/token_authority/authorization_grants_controller.rb +119 -0
  9. data/app/controllers/token_authority/authorizations_controller.rb +105 -0
  10. data/app/controllers/token_authority/clients_controller.rb +99 -0
  11. data/app/controllers/token_authority/metadata_controller.rb +12 -0
  12. data/app/controllers/token_authority/resource_metadata_controller.rb +12 -0
  13. data/app/controllers/token_authority/sessions_controller.rb +228 -0
  14. data/app/helpers/token_authority/authorization_grants_helper.rb +27 -0
  15. data/app/models/concerns/token_authority/claim_validatable.rb +95 -0
  16. data/app/models/concerns/token_authority/event_logging.rb +144 -0
  17. data/app/models/concerns/token_authority/resourceable.rb +111 -0
  18. data/app/models/concerns/token_authority/scopeable.rb +105 -0
  19. data/app/models/concerns/token_authority/session_creatable.rb +101 -0
  20. data/app/models/token_authority/access_token.rb +127 -0
  21. data/app/models/token_authority/access_token_request.rb +193 -0
  22. data/app/models/token_authority/authorization_grant.rb +119 -0
  23. data/app/models/token_authority/authorization_request.rb +276 -0
  24. data/app/models/token_authority/authorization_server_metadata.rb +101 -0
  25. data/app/models/token_authority/client.rb +263 -0
  26. data/app/models/token_authority/client_id_resolver.rb +114 -0
  27. data/app/models/token_authority/client_metadata_document.rb +164 -0
  28. data/app/models/token_authority/client_metadata_document_cache.rb +33 -0
  29. data/app/models/token_authority/client_metadata_document_fetcher.rb +266 -0
  30. data/app/models/token_authority/client_registration_request.rb +214 -0
  31. data/app/models/token_authority/client_registration_response.rb +58 -0
  32. data/app/models/token_authority/jwks_cache.rb +37 -0
  33. data/app/models/token_authority/jwks_fetcher.rb +70 -0
  34. data/app/models/token_authority/protected_resource_metadata.rb +74 -0
  35. data/app/models/token_authority/refresh_token.rb +110 -0
  36. data/app/models/token_authority/refresh_token_request.rb +116 -0
  37. data/app/models/token_authority/session.rb +193 -0
  38. data/app/models/token_authority/software_statement.rb +70 -0
  39. data/app/views/token_authority/authorization_grants/new.html.erb +25 -0
  40. data/app/views/token_authority/client_error.html.erb +8 -0
  41. data/config/locales/token_authority.en.yml +248 -0
  42. data/config/routes.rb +29 -0
  43. data/lib/generators/token_authority/install/install_generator.rb +61 -0
  44. data/lib/generators/token_authority/install/templates/create_token_authority_tables.rb.erb +116 -0
  45. data/lib/generators/token_authority/install/templates/token_authority.rb +247 -0
  46. data/lib/token_authority/configuration.rb +397 -0
  47. data/lib/token_authority/engine.rb +34 -0
  48. data/lib/token_authority/errors.rb +221 -0
  49. data/lib/token_authority/instrumentation.rb +80 -0
  50. data/lib/token_authority/instrumentation_log_subscriber.rb +62 -0
  51. data/lib/token_authority/json_web_token.rb +78 -0
  52. data/lib/token_authority/log_event_subscriber.rb +43 -0
  53. data/lib/token_authority/routing/constraints.rb +71 -0
  54. data/lib/token_authority/routing/routes.rb +39 -0
  55. data/lib/token_authority/version.rb +4 -1
  56. data/lib/token_authority.rb +30 -1
  57. metadata +65 -5
  58. data/app/assets/stylesheets/token_authority/application.css +0 -15
  59. data/app/controllers/token_authority/application_controller.rb +0 -4
  60. data/app/helpers/token_authority/application_helper.rb +0 -4
  61. data/app/views/layouts/token_authority/application.html.erb +0 -17
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: token_authority
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dick Davis
@@ -23,6 +23,20 @@ dependencies:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
25
  version: 8.1.2
26
+ - !ruby/object:Gem::Dependency
27
+ name: jwt
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
26
40
  description: Rails engine allowing apps to act as their own OAuth 2.1 provider.
27
41
  email:
28
42
  - webmaster@dick.codes
@@ -30,18 +44,64 @@ executables: []
30
44
  extensions: []
31
45
  extra_rdoc_files: []
32
46
  files:
47
+ - CHANGELOG.md
33
48
  - MIT-LICENSE
34
49
  - README.md
35
50
  - Rakefile
36
- - app/assets/stylesheets/token_authority/application.css
37
- - app/controllers/token_authority/application_controller.rb
38
- - app/helpers/token_authority/application_helper.rb
51
+ - app/controllers/concerns/token_authority/client_authentication.rb
52
+ - app/controllers/concerns/token_authority/controller_event_logging.rb
53
+ - app/controllers/concerns/token_authority/initial_access_token_authentication.rb
54
+ - app/controllers/concerns/token_authority/token_authentication.rb
55
+ - app/controllers/token_authority/authorization_grants_controller.rb
56
+ - app/controllers/token_authority/authorizations_controller.rb
57
+ - app/controllers/token_authority/clients_controller.rb
58
+ - app/controllers/token_authority/metadata_controller.rb
59
+ - app/controllers/token_authority/resource_metadata_controller.rb
60
+ - app/controllers/token_authority/sessions_controller.rb
61
+ - app/helpers/token_authority/authorization_grants_helper.rb
62
+ - app/models/concerns/token_authority/claim_validatable.rb
63
+ - app/models/concerns/token_authority/event_logging.rb
64
+ - app/models/concerns/token_authority/resourceable.rb
65
+ - app/models/concerns/token_authority/scopeable.rb
66
+ - app/models/concerns/token_authority/session_creatable.rb
67
+ - app/models/token_authority/access_token.rb
68
+ - app/models/token_authority/access_token_request.rb
39
69
  - app/models/token_authority/application_record.rb
40
- - app/views/layouts/token_authority/application.html.erb
70
+ - app/models/token_authority/authorization_grant.rb
71
+ - app/models/token_authority/authorization_request.rb
72
+ - app/models/token_authority/authorization_server_metadata.rb
73
+ - app/models/token_authority/client.rb
74
+ - app/models/token_authority/client_id_resolver.rb
75
+ - app/models/token_authority/client_metadata_document.rb
76
+ - app/models/token_authority/client_metadata_document_cache.rb
77
+ - app/models/token_authority/client_metadata_document_fetcher.rb
78
+ - app/models/token_authority/client_registration_request.rb
79
+ - app/models/token_authority/client_registration_response.rb
80
+ - app/models/token_authority/jwks_cache.rb
81
+ - app/models/token_authority/jwks_fetcher.rb
82
+ - app/models/token_authority/protected_resource_metadata.rb
83
+ - app/models/token_authority/refresh_token.rb
84
+ - app/models/token_authority/refresh_token_request.rb
85
+ - app/models/token_authority/session.rb
86
+ - app/models/token_authority/software_statement.rb
87
+ - app/views/token_authority/authorization_grants/new.html.erb
88
+ - app/views/token_authority/client_error.html.erb
89
+ - config/locales/token_authority.en.yml
41
90
  - config/routes.rb
91
+ - lib/generators/token_authority/install/install_generator.rb
92
+ - lib/generators/token_authority/install/templates/create_token_authority_tables.rb.erb
93
+ - lib/generators/token_authority/install/templates/token_authority.rb
42
94
  - lib/tasks/token_authority_tasks.rake
43
95
  - lib/token_authority.rb
96
+ - lib/token_authority/configuration.rb
44
97
  - lib/token_authority/engine.rb
98
+ - lib/token_authority/errors.rb
99
+ - lib/token_authority/instrumentation.rb
100
+ - lib/token_authority/instrumentation_log_subscriber.rb
101
+ - lib/token_authority/json_web_token.rb
102
+ - lib/token_authority/log_event_subscriber.rb
103
+ - lib/token_authority/routing/constraints.rb
104
+ - lib/token_authority/routing/routes.rb
45
105
  - lib/token_authority/version.rb
46
106
  homepage: https://github.com/dickdavis/token-authority
47
107
  licenses:
@@ -1,15 +0,0 @@
1
- /*
2
- * This is a manifest file that'll be compiled into application.css, which will include all the files
3
- * listed below.
4
- *
5
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
- *
8
- * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
- * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
- * files in this directory. Styles in this file should be added after the last require_* statement.
11
- * It is generally better to create a new file per style scope.
12
- *
13
- *= require_tree .
14
- *= require_self
15
- */
@@ -1,4 +0,0 @@
1
- module TokenAuthority
2
- class ApplicationController < ActionController::Base
3
- end
4
- end
@@ -1,4 +0,0 @@
1
- module TokenAuthority
2
- module ApplicationHelper
3
- end
4
- end
@@ -1,17 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Token authority</title>
5
- <%= csrf_meta_tags %>
6
- <%= csp_meta_tag %>
7
-
8
- <%= yield :head %>
9
-
10
- <%= stylesheet_link_tag "token_authority/application", media: "all" %>
11
- </head>
12
- <body>
13
-
14
- <%= yield %>
15
-
16
- </body>
17
- </html>