repl_identity 0.3.0 → 0.4.0

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: 11bc19b2b6a2640d9a64cd4305044228fb7548c74f9ce1fb211b2e6f841cf24e
4
- data.tar.gz: 3f316f9797dc022bafd7ca262f1810a83366d772430848682bd8ad55fd5db73d
3
+ metadata.gz: 5f687fe19b7d1febbe831bd4864cb9b6bdd4ff08e46c6030be9764089f14427d
4
+ data.tar.gz: 488d8db68d0c654cf6b10554946aa4c5776ff621bcb87bdbe798901cc84df0c1
5
5
  SHA512:
6
- metadata.gz: 91079e042a43cf22a13fc7e2a964c941509245fa9bd0e4895b5ee329c66201e17f3e31684936fed2e60c72beae00db7389f986f25cfd94c86ebe3678ce36fecf
7
- data.tar.gz: 3f3917089a8d895fd22431a27590500382b4ccd34bcf79bd6df549681cee462b3736b6fee40ebe434baa4497d5851a433644f4f05a35214f8402b6068258a10a
6
+ metadata.gz: 17393269caddc31e1346e8dbb5aae70071042d009cba240608afeff36265dd4a8318286d1e77ab78736bafa2e9d7111a38699fe87451bfaa0998563d07ad600a
7
+ data.tar.gz: 6ea513615be402e384ce7bb09bcfae6e4a9a55aafbbc4db0ed095537247a04909ebba60af9d0cb906e7d7d7a35bfe489f2f071191d137a5af715160a9a8a7f8d
@@ -13,7 +13,7 @@ module ReplIdentity
13
13
 
14
14
  identity = status.success? ? JSON.parse(stdout) : {}
15
15
 
16
- @verified = status.success?
16
+ @success = status.success?
17
17
  @audience = identity["aud"]
18
18
  @repl_slug = identity["slug"]
19
19
  @username = identity["user"]
@@ -23,8 +23,10 @@ module ReplIdentity
23
23
  @origin_repl_id = identity["originReplid"]
24
24
  end
25
25
 
26
- def verified?
27
- @verified
26
+ def verified?(client_repl_id)
27
+ @success &&
28
+ [@repl_id, @origin_repl_id].include?(client_repl_id) &&
29
+ @audience == REPL_ID
28
30
  end
29
31
  end
30
32
  end
data/lib/repl_identity.rb CHANGED
@@ -5,7 +5,7 @@ require_relative "repl_identity/token"
5
5
  require_relative "repl_identity/identity"
6
6
 
7
7
  module ReplIdentity
8
- VERSION = "0.3.0"
8
+ VERSION = "0.4.0"
9
9
  REPL_ID = ENV["REPL_ID"]
10
10
  REPLIT_CLI_PATH = ENV.fetch("REPLIT_CLI", "replit")
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: repl_identity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - CodingCactus
@@ -60,11 +60,11 @@ files:
60
60
  - lib/repl_identity.rb
61
61
  - lib/repl_identity/identity.rb
62
62
  - lib/repl_identity/token.rb
63
- homepage: https://github.com/Coding-Cactus/repl_identityrb
63
+ homepage: https://github.com/Coding-Cactus/repl-identity-ruby
64
64
  licenses:
65
65
  - MIT
66
66
  metadata:
67
- source_code_uri: https://github.com/Coding-Cactus/repl_identityrb
67
+ source_code_uri: https://github.com/Coding-Cactus/repl-identity-ruby
68
68
  post_install_message:
69
69
  rdoc_options: []
70
70
  require_paths: