card-mod-api_key 0.13.2 → 0.14.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: 3b08ecec477698c6c6f48fb42f9e13ac35bfe373427bfff3892d0414b9dc44b5
4
- data.tar.gz: 1c15dd649ef0ac6ed9c61dfcaef356ec4ce02bf275ec8ac79b48ba4451311eb0
3
+ metadata.gz: 581378115d878453dc9b24efb01820af4d9597434b41011f1902a01a738ea4af
4
+ data.tar.gz: 8f905fad0aa88d24a5e727e65905742f95f62e0dd6517d8ea607efde76253948
5
5
  SHA512:
6
- metadata.gz: 42ce8c60e4d1bea0c60b3df24577357c56e73cde7585cb6f9905239fd518e4bfb747d1abd4f69b65b92bb0802603a25546ae8435aeee37986eed3b1f1fb086f6
7
- data.tar.gz: 311cd016a62676eaaa8f6865abc4a3e7f40531388b064b345fc31b841ce234f53265a3ba2ec24356de49fa83862412c86295408f0df83730af1ef4ac417ebbb8
6
+ metadata.gz: c06b8b925e8094bfbf2106e609a101abedd95f07befb0cdc86882b7325ad9d248843846c5ac1cc86a4c37d7dc57dc573548586ce1c7e8fffe0f801d78703001c
7
+ data.tar.gz: 8da965f4b7dd09bad689e0d604754e6de13c3e228ae0f4e9b7805223a9a7fb4d4d8a7be5bd17e716eb7017b04b010e0ed2ced6468021e6cbf5134d0c299b5bfa
data/README.md CHANGED
@@ -1,8 +1,7 @@
1
1
  <!--
2
- # @title README - mod: API key
2
+ # @title README - mod: api key
3
3
  -->
4
-
5
- # API key Mod
4
+ # API Key mod
6
5
  Enable Decko users to perform authorized web requests associated with their account
7
6
  without a session.
8
7
 
@@ -30,6 +30,10 @@ class Card
30
30
  def find_account_by_api_key api_key
31
31
  find_account_by :api_key, api_key.strip
32
32
  end
33
+
34
+ def api_act?
35
+ Env.controller&.try(:authenticators)&.values&.compact.present?
36
+ end
33
37
  end
34
38
  end
35
39
  end
@@ -2,6 +2,8 @@ class CardController
2
2
  # add support for passing api key through header using X-API-Key
3
3
  module ApiKey
4
4
  def authenticators
5
+ return {} unless request
6
+
5
7
  super.merge api_key: api_key_from_header || params[:api_key]
6
8
  end
7
9
 
data/locales/de.yml ADDED
@@ -0,0 +1,11 @@
1
+ de:
2
+ api_key_not_found: keineb API-Schlüssel gefunden
3
+ api_key_incorrect: API-Schlüssel stimmt nicht überein
4
+ api_key_invalid: "Ungültiger API-Schlüssel; darf nur 20+ alphanumerische Zeichen enthalten"
5
+ api_key_label: "API-Schlüssel"
6
+ api_key_generate: "API-Schlüssel erzeugen"
7
+ api_key_regenerate: "API-Schlüssel neu erzeugen"
8
+ api_key_generating: "API-Schlüssel wird erzeugt"
9
+ api_key_taken: "API-Schlüssel vergeben"
10
+ api_key_get_jwt_token: "ein JWT-Token abrufen"
11
+ api_key_no_key: "Kein Schlüssel."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-api_key
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.2
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-08-06 00:00:00.000000000 Z
13
+ date: 2022-01-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: card
@@ -18,28 +18,28 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.103.2
21
+ version: 1.104.1
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 1.103.2
28
+ version: 1.104.1
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: card-mod-account
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.13.2
35
+ version: 0.14.1
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.13.2
42
+ version: 0.14.1
43
43
  description: ''
44
44
  email:
45
45
  - info@decko.org
@@ -51,6 +51,7 @@ files:
51
51
  - init/late/api_key.rb
52
52
  - lib/card/auth/api_key.rb
53
53
  - lib/card_controller/api_key.rb
54
+ - locales/de.yml
54
55
  - locales/en.yml
55
56
  - set/right/account.rb
56
57
  - set/right/api_key.rb
@@ -80,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
81
  - !ruby/object:Gem::Version
81
82
  version: '0'
82
83
  requirements: []
83
- rubygems_version: 3.1.6
84
+ rubygems_version: 3.2.15
84
85
  signing_key:
85
86
  specification_version: 4
86
87
  summary: API Keys and JWT Tokens for Decko