credible 0.2.0 → 0.2.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: 26e8296ed1bf8eccded84ae3f9d856942475bd0a9f4599b5b7a396932e280fce
4
- data.tar.gz: 61f7119a19a8295f1ea82aa62074417a04cc2ba7fd64d5b81147fdfe931507c1
3
+ metadata.gz: af0ef8a69bffbd53bfaf823fc29a107cb6e8ae2d8da42b7463367c6cf0443c3e
4
+ data.tar.gz: 2fa77fbeaa822062e66fd2fcfa4eeef4046dc27f16c620389a2a38cd6c156b20
5
5
  SHA512:
6
- metadata.gz: f33e0db40e889814c25dbefd88efe0ea6f39fa67d3eb966054b07064b5268e89cdcb58a056ded8c79b54d7df7c7f87da6e2eaf22b6d1298966c4820998795d50
7
- data.tar.gz: 1e260353acc82654382167391a2cd8ba3d4f69eb0ef1ce37edcb25bfd72cceaa8f87ceb30176e490ac2e90358892588aefadade526b1f383d132e5307882c36a
6
+ metadata.gz: bbbe6d188e62a58ea4029a209a4f63d0987f359f3370b50657c710887e3708cd6fc04e5213073bd689a2a63af5a1ffc0b6ef1dbea94dfd186e6023f4a98755e3
7
+ data.tar.gz: 7aef0eb8eaf40fc6f5dd8f53213cb993452c67f27cee3de7ba01b25206e8252f92a6385365fa85826b0e843dc17e3937fe2cb87cbe8d0d1e7cebe13256e93ade
data/README.md CHANGED
@@ -5,6 +5,9 @@
5
5
  [![Gem](https://img.shields.io/gem/v/credible?logo=rubygems)](https://rubygems.org/gems/credible)
6
6
 
7
7
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](MIT-LICENSE)
8
+ [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
9
+ [![Contributing](https://img.shields.io/badge/contributions-welcome-blue.svg)](CONTRIBUTING.md)
10
+ [![Discord](https://img.shields.io/discord/697123984231366716?color=7289da&label=chat&logo=discord)](https://discord.gg/YMU87db)
8
11
 
9
12
  Credible was extracted from [thombruce/helvellyn](https://github.com/thombruce/helvellyn) and is still a work in progress. The goal is to provide JWT and API token based authentication using [Warden](https://github.com/wardencommunity/warden/) for Rails API applications.
10
13
 
@@ -9,13 +9,13 @@ class Credible::UserMailer < Credible::ApplicationMailer
9
9
  @user = params[:user]
10
10
  @url = root_url(host: @settings.hostname)
11
11
  @confirmation_url = @url + 'confirm/' + @user.confirmation_token
12
- mail(from: @settings.email, to: @user.email, subject: "Welcome to #{@settings.name} | Please confirm your account")
12
+ mail(from: @settings.email, to: @user.email, subject: "Welcome to #{Rails.application.class.module_parent_name} | Please confirm your account")
13
13
  end
14
14
 
15
15
  def invitation_email
16
16
  @settings = Settings.instance
17
17
  @user = params[:user]
18
18
  @url = root_url(host: @settings.hostname)
19
- mail(from: @settings.email, to: @user.email, subject: "You have been invited to #{@settings.name}")
19
+ mail(from: @settings.email, to: @user.email, subject: "You have been invited to #{Rails.application.class.module_parent_name}")
20
20
  end
21
21
  end
@@ -25,7 +25,7 @@ Warden::Strategies.add(:jwt) do
25
25
  jwt = header.gsub(pattern, '') if header && header.match(pattern)
26
26
  token =
27
27
  JWT.decode jwt, Rails.application.secrets.secret_key_base, true,
28
- iss: 'Helvellyn', verify_iss: true, algorithm: 'HS256' # [1]
28
+ iss: Rails.application.class.module_parent_name, verify_iss: true, algorithm: 'HS256' # [1]
29
29
  rescue JWT::InvalidIssuerError
30
30
  fail!('Could not authenticate')
31
31
  end
@@ -12,7 +12,7 @@ module Credible
12
12
  def jwt
13
13
  payload = {
14
14
  data: jwt_data,
15
- iss: 'Helvellyn'
15
+ iss: Rails.application.class.module_parent_name
16
16
  }
17
17
  JWT.encode payload, Rails.application.secrets.secret_key_base, 'HS256' # [1]
18
18
  end
@@ -1,3 +1,3 @@
1
1
  module Credible
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: credible
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thom Bruce