octopus_auth 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/Gemfile.lock +1 -1
- data/lib/octopus_auth/issue.rb +9 -3
- data/lib/octopus_auth/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7add3210fd9489bfec1179adce0134f27b1fc791524b6106b83feb5eb93ed2a
|
4
|
+
data.tar.gz: ee7e21b782bc8d6497b936e2672eba8fe68f45d80e8657fe3ffc622001d6a1f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1ce828aea7ef922e7e49c5eda179d874626c7a62c3bc1b9cf19b5c33b9207125db1a4e89a0594838b9a9d79bd40d98140cff04d41b58eb095dec2e98773dac3
|
7
|
+
data.tar.gz: e1b2ba2ed8a0017ac15496f04f55b639939abd85e059bf6381e8936725d5882994e29a97f6f9835fac9bd3252c5f8b85088a0b1efa9b73f226540d963b83b62c
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
All notable changes to this project are documented in this file.
|
4
|
+
This project adheres to [Semantic Versioning](http://semver.org/).
|
5
|
+
|
6
|
+
## octopus_auth 0.1.1
|
7
|
+
|
8
|
+
- Allow custom `expires_at` when issue token
|
9
|
+
|
10
|
+
## octopus_auth 0.1.0
|
11
|
+
|
12
|
+
- Init project with `Issue` `Revoke` `Queries::Get` `Queries::ByScope` and authentication mechanism `Authenticator`
|
data/Gemfile.lock
CHANGED
data/lib/octopus_auth/issue.rb
CHANGED
@@ -2,11 +2,13 @@ require "octopus_auth/token_generator"
|
|
2
2
|
|
3
3
|
module OctopusAuth
|
4
4
|
class Issue
|
5
|
-
def initialize(scope, owner_type, owner_id, creator_id)
|
5
|
+
def initialize(scope, owner_type, owner_id, creator_id, expires_at: nil)
|
6
6
|
@owner_type = owner_type
|
7
7
|
@owner_id = owner_id
|
8
8
|
@creator_id = creator_id
|
9
9
|
@scope = scope.to_sym
|
10
|
+
|
11
|
+
@expires_at = expires_at
|
10
12
|
end
|
11
13
|
|
12
14
|
def execute
|
@@ -14,7 +16,11 @@ module OctopusAuth
|
|
14
16
|
|
15
17
|
# Set attributes
|
16
18
|
access_token.issued_at = Time.now.utc
|
17
|
-
|
19
|
+
if @expires_at
|
20
|
+
access_token.expires_at = @expires_at
|
21
|
+
else
|
22
|
+
access_token.expires_at = access_token.issued_at + OctopusAuth.configuration.token_life_time
|
23
|
+
end
|
18
24
|
access_token.active = true
|
19
25
|
|
20
26
|
access_token.owner_type = @owner_type
|
@@ -22,8 +28,8 @@ module OctopusAuth
|
|
22
28
|
access_token.creator_id = @creator_id
|
23
29
|
|
24
30
|
access_token.scope = filtered_scope
|
25
|
-
|
26
31
|
access_token.token = generate_token
|
32
|
+
|
27
33
|
access_token.save!
|
28
34
|
|
29
35
|
OctopusAuth::Decorators::Default.new(access_token)
|
data/lib/octopus_auth/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octopus_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TINYpulse Devops
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -92,6 +92,7 @@ files:
|
|
92
92
|
- ".ruby-gemset"
|
93
93
|
- ".ruby-version"
|
94
94
|
- ".travis.yml"
|
95
|
+
- CHANGELOG.md
|
95
96
|
- CODE_OF_CONDUCT.md
|
96
97
|
- Gemfile
|
97
98
|
- Gemfile.lock
|