omniauth-usosumk 0.1.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f83d5eece64b0ca9987909f7304b2990ead843125e88c3ace244b54f76355f94
4
+ data.tar.gz: 24c3aeb0e26c83d32e723e91905178ecacb3c8764982a2b73ac8ee2f75a214e5
5
+ SHA512:
6
+ metadata.gz: 6ae7360e51230e1ce3ea9aacc51db8e96a20fb4fda5845a223f9c2329612ebfc72afa76543bb341cceb6be5d49d198c2bd024286530117f1ed64667b3fb8b3bb
7
+ data.tar.gz: 05e528398a3bd1fdb730cf09e659e0b6d755762b39ee04f63aadc046a0972c7ac50175365a24f7d736bdcceeb4744b60809f655d235f8dee5494772042ab0af8
data/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # Omniauth::Usosumk
2
+ Short description and motivation.
3
+
4
+ ## Usage
5
+ How to use my plugin.
6
+
7
+ ## Installation
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem "omniauth-usosumk"
12
+ ```
13
+
14
+ And then execute:
15
+ ```bash
16
+ $ bundle
17
+ ```
18
+
19
+ Or install it yourself as:
20
+ ```bash
21
+ $ gem install omniauth-usosumk
22
+ ```
23
+
24
+ ## Contributing
25
+ Contribution directions go here.
26
+
27
+ ## License
28
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,3 @@
1
+ require "bundler/setup"
2
+
3
+ require "bundler/gem_tasks"
@@ -0,0 +1,35 @@
1
+ require 'omniauth-oauth'
2
+ require 'json'
3
+
4
+ module OmniAuth
5
+ module Strategies
6
+ class Usosumk < OmniAuth::Strategies::OAuth
7
+ option :name, 'usosumk'
8
+ option :callback_url, "http://127.0.0.1:3000/oauth/callback"
9
+
10
+ option :client_options, {site: "https://usosapps.umk.pl",
11
+ request_token_url: "/services/oauth/request_token?scopes=email",
12
+ authorize_url: "https://usosapps.umk.pl/services/oauth/authorize",
13
+ access_token_url: "/services/oauth/access_token"}
14
+
15
+ uid { raw_info["id"] }
16
+
17
+ info do
18
+ {
19
+ :email => raw_info["email"],
20
+ :first_name => raw_info["first_name"],
21
+ :last_name => raw_info["last_name"],
22
+ }
23
+ end
24
+
25
+ extra do
26
+ skip_info? ? {} : { :raw_info => raw_info }
27
+ end
28
+
29
+ def raw_info
30
+ @raw_info ||= JSON.load(access_token.get("/services/users/user?fields=id|first_name|last_name|email").body)
31
+ end
32
+
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,5 @@
1
+ module Omniauth
2
+ module Usosumk
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,2 @@
1
+ require "omniauth-usosumk/version"
2
+ require 'omniauth/strategies/usosumk'
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-usosumk
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - mikolajczu
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-01-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 7.0.4
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 7.0.4
27
+ description: Oauth strategy for Usos umk
28
+ email:
29
+ - mikeyczu@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - README.md
35
+ - Rakefile
36
+ - lib/omniauth-usosumk.rb
37
+ - lib/omniauth-usosumk/version.rb
38
+ - lib/omniauth/strategies/usosumk.rb
39
+ homepage: https://github.com/mikolajczu/omniauth-usosumk.git
40
+ licenses: []
41
+ metadata:
42
+ homepage_uri: https://github.com/mikolajczu/omniauth-usosumk.git
43
+ source_code_uri: https://github.com/mikolajczu/omniauth-usosumk.git
44
+ post_install_message:
45
+ rdoc_options: []
46
+ require_paths:
47
+ - lib
48
+ required_ruby_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ requirements: []
59
+ rubygems_version: 3.3.26
60
+ signing_key:
61
+ specification_version: 4
62
+ summary: summary
63
+ test_files: []