psu_identity 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 737e36dfa498aa6e702abe12bb194cf20d21529ef8ec461d6fd0c1649cc329dd
4
- data.tar.gz: 448a9a648d169fb90d9824582217733b2e121df8efa3ad6ae12b430709443d3e
3
+ metadata.gz: 51ee8619629274ba4e705f67c851420a9a3e773ab3d5bbd1e08587ebe64f3ecb
4
+ data.tar.gz: 4bf4eacbc97b634d13bae26652362343e1c3c8780d3dfb455371b10ab85fa6e8
5
5
  SHA512:
6
- metadata.gz: ad1b66f4a4a098a964d0223feecb453b01bfe6c26f76749e47a4c66a5945c855750d984792bb550527e9a10f70b8a96b29126e6ea3aafb2602ba38238aaad4b2
7
- data.tar.gz: f1f7deb980d893b3489e48cbfdd653e45603c80238682a069d20b3be6f32f5956890a3eb807127f6e5ed475db89e2616388f58b029c939a78cfd256512c6e188
6
+ metadata.gz: 3781788fd2253c99aa1113952502473e1ebd1d58fabf4d1771d56e7831db33085a4433f3bb256f890e06ca51271a73354443c999ced1202446cb421e45c5417f
7
+ data.tar.gz: 92a6c28a1eb7ba9e8f3169fdb4ae116f45334b5b62f2e992ce3b9272298a467b01430242cb34a7b1fe4890caf9abf174682d814649b2fefe5b93cc4f0341bf8a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- psu_identity (0.6.0)
4
+ psu_identity (0.6.1)
5
5
  faraday (~> 1.0)
6
6
  json
7
7
  oauth2
@@ -20,6 +20,8 @@ module PsuIdentity::DirectoryService
20
20
  # @param [Hash] args of options to pass to the endpoint
21
21
  # @option args [String] :userid of the person
22
22
  def userid(userid)
23
+ raise NotFound if /\A[[:space:]]*\z/.match?(userid.to_s)
24
+
23
25
  process_userid_response connection.get("#{base_url}/people/#{userid}")
24
26
  end
25
27
 
@@ -49,12 +51,17 @@ module PsuIdentity::DirectoryService
49
51
  def token
50
52
  oauth_client = OAuth2::Client.new(client_id,
51
53
  client_secret, site: oauth_endpoint,
54
+ auth_scheme:,
52
55
  authorize_url: '/oauth/api/authz',
53
56
  token_url: '/oauth/api/token')
54
57
  oauth_token = oauth_client.client_credentials.get_token
55
58
  oauth_token.token
56
59
  end
57
60
 
61
+ def auth_scheme
62
+ @auth_scheme ||= ENV.fetch('PSU_ID_AUTH_SCHEME', 'request_body').to_sym
63
+ end
64
+
58
65
  def client_id
59
66
  @client_id ||= ENV.fetch('PSU_ID_OAUTH_CLIENT_ID')
60
67
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PsuIdentity
4
- VERSION = '0.6.0'
4
+ VERSION = '0.6.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: psu_identity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Kiessling
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-07 00:00:00.000000000 Z
11
+ date: 2024-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday