keratin-authn 1.0.1 → 1.0.2

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
  SHA1:
3
- metadata.gz: 6da81c6e1e1cfff24bdf967c5c639bf965a6bd36
4
- data.tar.gz: 16b387f8a34beb746cd96c5bcecbc6a0e2df3578
3
+ metadata.gz: b1336382812f7128c3798e4755704ed4ae5e7c0c
4
+ data.tar.gz: 129628c64978b64624b8b13d8bc25dbae57157eb
5
5
  SHA512:
6
- metadata.gz: 04788a20f670dd537bc463b1d818b7b39626c6745750f3ea3e70b481b8f04f1b3e6215c064165face2508e0d40a967c5ed98507807cb05cff98d20e9d5781f58
7
- data.tar.gz: b7c68b8969f1bbbc3f4b00df843245c66ef4620a42c748082bb5a6c8edcd8ff18094dc942bd78a3f5a308f24887c0d91b508f8d1127ee39d87e6c2381be7db92
6
+ metadata.gz: 1f4274f0ccdaa9feaa97746468fb41e3f6dcae8c1d84bc6ce89517ef6d4e326835305f33939a42f362549c02ef7f6dae96985dbc27ee041855e421703fae5130
7
+ data.tar.gz: e0c25194d2ee5909c451c5dc1b712e42352b8d89292ef1345529dd4a4f7998e3a040166f31be3921b989abf0fb0b821d05bcbb1c6bef0b9be3ec5d6af79c4d89
data/README.md CHANGED
@@ -5,7 +5,10 @@ Keratin AuthN is an authentication service that keeps you in control of the expe
5
5
  This gem provides utilities to help integrate with the backend of a Ruby application. You will also
6
6
  need a client for your frontend, such as [keratin/authn-js](https://github.com/keratin/authn-js).
7
7
 
8
- [![Gem Version](https://badge.fury.io/rb/keratin-authn.svg)](http://badge.fury.io/rb/keratin-authn) [![Build Status](https://travis-ci.org/keratin/authn-rb.svg?branch=master)](https://travis-ci.org/keratin/authn-rb) [![Coverage Status](https://coveralls.io/repos/github/keratin/authn/badge.svg?branch=master)](https://coveralls.io/github/keratin/authn?branch=master)
8
+ [![Gitter](https://badges.gitter.im/keratin/authn-server.svg)](https://gitter.im/keratin/authn-server?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
9
+ [![Gem Version](https://badge.fury.io/rb/keratin-authn.svg)](http://badge.fury.io/rb/keratin-authn)
10
+ [![Build Status](https://travis-ci.org/keratin/authn-rb.svg?branch=master)](https://travis-ci.org/keratin/authn-rb)
11
+ [![Coverage Status](https://coveralls.io/repos/github/keratin/authn/badge.svg?branch=master)](https://coveralls.io/github/keratin/authn?branch=master)
9
12
 
10
13
  ## Installation
11
14
 
@@ -50,12 +53,6 @@ end
50
53
  Use `Keratin::AuthN.subject_from(params[:authn])` to fetch an `account_id` from the session if and
51
54
  only if the session is valid.
52
55
 
53
- ### Logging Out
54
-
55
- Send users to `Keratin::AuthN.logout_url(return_to: some_path)` to log them out from the AuthN
56
- server. If you use [keratin/authn-js](https://github.com/keratin/authn-js), you might prefer the
57
- logout functionality there as it can also take care of deleting the cookie.
58
-
59
56
  ### Modifying Accounts
60
57
 
61
58
  * `Keratin.authn.update(account_id, username: 'new@example.tech')`: will synchronize an email change
data/lib/keratin/authn.rb CHANGED
@@ -9,9 +9,10 @@ require 'lru_redux'
9
9
  require 'json/jwt'
10
10
 
11
11
  module Keratin
12
+ # Client for AuthN API calls
12
13
  def self.authn
13
14
  @authn ||= AuthN::API.new(
14
- AuthN.config.authn_url || AuthN.config.issuer,
15
+ AuthN.config.authn_url,
15
16
  username: AuthN.config.username,
16
17
  password: AuthN.config.password
17
18
  )
@@ -30,7 +31,10 @@ module Keratin
30
31
  # the base url for API calls. this is useful if you've divided your network so private API
31
32
  # requests can not be probed by public devices. it is optional, and will default to issuer.
32
33
  # e.g. "https://authn.internal.dns"
33
- attr_accessor :authn_url
34
+ attr_writer :authn_url
35
+ def authn_url
36
+ @authn_url || issuer
37
+ end
34
38
 
35
39
  # how long (in seconds) to keep keys in the keychain before refreshing.
36
40
  # default: 3600
@@ -56,10 +60,10 @@ module Keratin
56
60
  config.logger.debug{ yield } if config.logger
57
61
  end
58
62
 
59
- # The default keychain will fetch JWKs from the configured issuer and return the correct key by
60
- # id. Keys are cached in memory to reduce network traffic.
63
+ # The default keychain will fetch JWKs from AuthN and return the correct key by id. Keys are
64
+ # cached in memory to reduce network traffic.
61
65
  def self.keychain
62
- @keychain ||= FetchingKeychain.new(issuer: config.issuer, ttl: config.keychain_ttl)
66
+ @keychain ||= FetchingKeychain.new(issuer: config.authn_url, ttl: config.keychain_ttl)
63
67
  end
64
68
 
65
69
  # If the default keychain is not desired (as in host application tests), different keychain may
@@ -1,5 +1,5 @@
1
1
  module Keratin # rubocop:disable Style/ClassAndModuleChildren
2
2
  module AuthN
3
- VERSION = '1.0.1'
3
+ VERSION = '1.0.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keratin-authn
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lance Ivy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-05 00:00:00.000000000 Z
11
+ date: 2018-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json-jwt