yiffspace 0.0.9 → 0.0.10

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: 3cae6e6673d3c50b8899ec0c198d88af750ba9729804c8c6912ba8a14cf6712a
4
- data.tar.gz: be9e9e433eca4720756d0a113b383159e4b4572b9bc4783f6eab6755c24de4f7
3
+ metadata.gz: f112970fd5ee72b9230c1b3236a3831671bb2dfedd098b4e00a061ebfcff6cf1
4
+ data.tar.gz: 71c2f7b6b44f0988c00716882dc45c0da80ad7d8b4fa63f8e12aa9d807971b68
5
5
  SHA512:
6
- metadata.gz: 6979ad72bc811ea8bc2c831e60122c2f4bd5fe75cca656866a5d607df51c2822f66d8a5d0436f1f984f401683deeb8605ae7821dfceba4bc929732b7d96274ac
7
- data.tar.gz: f96a1cff3676ef954004f9006524760894e44fa134445c6359b30beb118c7f6326263fc529b79306cc80f7b708cb37af70e6af41e6db8b68ef66686831f52339
6
+ metadata.gz: 5321ef4adb4ac4cf98aac76492bd1ae15c8bd98efcf91e65a39fa39f1e06c32e5153a12650ecee959269a1b0d069ac83590dd758f4809ef8166566caf8be70d2
7
+ data.tar.gz: bf65d46d86952bdcd8006a821f69220607eec81fc8da392b9a9dbc699976c698ab38e3fe922a577eea480d5e8c928aa0873494c1f697371e51b9b0fcdd6adb76
@@ -5,8 +5,8 @@ require_relative("../core_ext/logto/named_session_storage")
5
5
  module YiffSpace
6
6
  module Auth
7
7
  class Client
8
- attr_accessor(:client_id, :client_secret, :scopes, :resource,
9
- :redirect_uri, :server_url, :auth_session_key,
8
+ attr_accessor(:client_id, :client_secret, :scopes, :permissions,
9
+ :resource, :redirect_uri, :server_url, :auth_session_key,
10
10
  :user_session_key, :update_discord_images, :permissions_separator)
11
11
 
12
12
  attr_reader(:name)
@@ -14,6 +14,7 @@ module YiffSpace
14
14
  def initialize(name)
15
15
  @name = name.to_sym
16
16
  @scopes = %i[openid offline_access profile roles identities]
17
+ @permissions = []
17
18
  @redirect_uri = "http://127.0.0.1:3000/auth/cb"
18
19
  @server_url = "https://auth.yiff.space"
19
20
  @auth_session_key = :"yiffspace_auth_#{name}"
@@ -28,7 +29,7 @@ module YiffSpace
28
29
  endpoint: server_url,
29
30
  app_id: client_id,
30
31
  app_secret: client_secret,
31
- scopes: scopes,
32
+ scopes: scopes + permissions,
32
33
  resources: [resource].compact,
33
34
  ),
34
35
  # Allow the client to redirect to other hosts (i.e. your Logto tenant)
@@ -30,7 +30,7 @@ module YiffSpace
30
30
 
31
31
  def has?(perm)
32
32
  current = @tree
33
- parts = perm.split(".")
33
+ parts = perm.split(@separator)
34
34
 
35
35
  parts.each do |part|
36
36
  return false unless current[part]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YiffSpace
4
- VERSION = "0.0.9"
4
+ VERSION = "0.0.10"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yiffspace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Donovan_DMC