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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22ad32580ab09d2547713decfdbb931a19211a58a8b9459cf821fba7fac1a171
4
- data.tar.gz: 1e92ebcbf73cfd2d1572137205a5a0159928699ca2cff07dcb74d6cb6ed0c3f4
3
+ metadata.gz: b7add3210fd9489bfec1179adce0134f27b1fc791524b6106b83feb5eb93ed2a
4
+ data.tar.gz: ee7e21b782bc8d6497b936e2672eba8fe68f45d80e8657fe3ffc622001d6a1f8
5
5
  SHA512:
6
- metadata.gz: e7e83cf01853b8c1a7285a21ef17a5850f09c4127d645ce6acb63559dd8c83cc0ff5330a16d6eabce9413435e996e1767311e152bb8c77dfc78190cf5cc6e581
7
- data.tar.gz: 994a3cb6104aa16ce17475641ed5ab65053b7fe39069d5e9a2522eb9cde5aa408725bb510019250890ad1ca1e50620f9cd5b368e750dfc4b15590f8d87d8cfb2
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- octopus_auth (0.1.0)
4
+ octopus_auth (0.1.1)
5
5
  activerecord (>= 3.0.0)
6
6
 
7
7
  GEM
@@ -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
- access_token.expires_at = access_token.issued_at + OctopusAuth.configuration.token_life_time
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)
@@ -1,3 +1,3 @@
1
1
  module OctopusAuth
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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-04 00:00:00.000000000 Z
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