openid_config_parser 0.1.0 → 0.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e6969bede8f44bf2203a6917e280f2e4347ee75f3516aea689be0bc425b2f8f
4
- data.tar.gz: a0e8f84fb2aaf9c7069181045c1b25059ba0a5d0b503120df72cc2904299d64c
3
+ metadata.gz: ddd178567c09e3fbf06238765bb5b54e17f8127af335359a438ae62423f7b4c7
4
+ data.tar.gz: f569c653f34e4d11fbcfa922c861a5afa57f9eba9ee125c3a7cbf89c46497848
5
5
  SHA512:
6
- metadata.gz: 217597b11081a62d69e4f383b863510075eb5732792ac0da2a34e7b05682362be5cfcdf067e779ef0ca8f9e2309dde636b057358a8f8a45bc0cf5e8d9479bdd9
7
- data.tar.gz: 99bea3a17f85689e438f545e629be4111bc97f037d506367452e9dd30210f74839d632ef22bae5fc08c1126c8610bbc9f4bd3a20e94821383e64fd3d987c3763
6
+ metadata.gz: 78bf5c62d4a329e0682d91e6cf3cc6885ed096e44be98e5707c73edb8a0fd4a9b58c67b7db7cd1724e723cde16d9a149b66f393e0d1240da3c9bcc5a639dd939
7
+ data.tar.gz: d91c6b19898d912b2ddf3856ed70732ece864cff8e34767e69fcdcfad57cef454d5ceee3be4f40438a266eea7e68dd184793542505fb1d78b2d146b85d6ac69d
data/CHANGELOG.md CHANGED
@@ -1,4 +1,7 @@
1
1
  ## [Released]
2
2
 
3
+ ## [0.1.1] - 2024-05-26
4
+ - Update readme
5
+
3
6
  ## [0.1.0] - 2024-05-26
4
7
  - Initial release
data/README.md CHANGED
@@ -1,34 +1,61 @@
1
1
  # OpenidConfigParser
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
4
-
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/openid_config_parser`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ `openid_config_parser` is a lightweight Rubygem containing a method that fetches and
4
+ parses OpenID Connect configuration data from a specified endpoint URL and returns a Hash
5
+ object. It includes error handling to manage various issues that might occur during the
6
+ HTTP request and JSON parsing process.
6
7
 
7
8
  ## Installation
8
9
 
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
-
11
- Install the gem and add to the application's Gemfile by executing:
10
+ To install the gem run the following command in the terminal:
12
11
 
13
- $ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
12
+ $ bundle add openid_config_parser
14
13
 
15
14
  If bundler is not being used to manage dependencies, install the gem by executing:
16
15
 
17
- $ gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
16
+ $ gem install openid_config_parser
18
17
 
19
18
  ## Usage
20
19
 
21
- TODO: Write usage instructions here
22
-
23
- ## Development
24
-
25
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
26
-
27
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
20
+ For non-Rails application you might need to require the gem in your file like so:
21
+
22
+ ```ruby
23
+ require 'openid_config_parser'
24
+ ```
25
+
26
+ You can use the `openid_config_parser` in any of your Rails controllers, models, or
27
+ other parts of your application.
28
+
29
+ ```ruby
30
+ # app/controllers/application_controller.rb
31
+
32
+ class ApplicationController < ActionController::Base
33
+ def fetch_openid_config
34
+ endpoint = "https://example.com/.well-known/openid-configuration"
35
+ config = OpenidConfigParser.fetch_openid_configuration(endpoint)
36
+
37
+ if config
38
+ issuer = config[:issuer]
39
+ auth_endpoint = config[:authorization_endpoint]
40
+ token_endpoint = config[:token_endpoint]
41
+ jwks_uri = config[:]
42
+ userinfo_endpoint = config[:userinfo_endpoint]
43
+ # and so on
44
+ else
45
+ Rails.logger.error "Failed to fetch OpenID configuration"
46
+ end
47
+ rescue OpenidConfigParser::Error => e
48
+ Rails.logger.error "Error fetching OpenID configuration: #{e.message}"
49
+ end
50
+ end
51
+ ```
52
+
53
+ Considering that HTTP request is made to fetch the endpoint configuration, you can call
54
+ this method in a background job for optimized performance.
28
55
 
29
56
  ## Contributing
30
57
 
31
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/openid_config_parser. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/openid_config_parser/blob/main/CODE_OF_CONDUCT.md).
58
+ Bug reports and pull requests are welcome on GitHub at https://github.com/msuliq/openid_config_parser. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/msuliq/openid_config_parser/blob/main/CODE_OF_CONDUCT.md).
32
59
 
33
60
  ## License
34
61
 
@@ -36,4 +63,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
36
63
 
37
64
  ## Code of Conduct
38
65
 
39
- Everyone interacting in the OpenidConfigParser project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/openid_config_parser/blob/main/CODE_OF_CONDUCT.md).
66
+ Everyone interacting in the OpenidConfigParser project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/msuliq/openid_config_parser/blob/main/CODE_OF_CONDUCT.md).
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenidConfigParser
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openid_config_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Suleyman Musayev