entitlements-app 1.2.8 → 1.2.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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a782de54803d00a4afb8383789c796efbe8375eb92641c5537507f77eb4fb192
|
|
4
|
+
data.tar.gz: 2a53134a1ec22d96647f1739f6263a381d42d3a10620588d9c7561ff49a79e08
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 24254d8ce6d94b3c9b011effa5334c173db77dda656b72ce9bf40f82990a32328892b775d150642430d05c23cf0d4c114d4fe63b7455eab07c25465fed873369
|
|
7
|
+
data.tar.gz: 95e6dc2fafc0df322a9817a245e0c2131daa117a4dc919b4efbcd72d289e8349a09403b2111982e19c9db11c67b8d38090e091d3a71f8cc15168e83d3c118cac
|
|
@@ -80,7 +80,7 @@ module Entitlements
|
|
|
80
80
|
member_set = Entitlements::Data::Groups::Calculated::Rules::Group.matches(
|
|
81
81
|
value: group_ref,
|
|
82
82
|
)
|
|
83
|
-
member_set.map { |person| person.uid.downcase }
|
|
83
|
+
member_set.map { |person| person.uid.downcase }.to_set
|
|
84
84
|
end
|
|
85
85
|
|
|
86
86
|
Entitlements.cache[:member_of_named_group][group_ref].include?(member.uid.downcase)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require "monitor"
|
|
3
4
|
require_relative "calculated/base"
|
|
4
5
|
require_relative "calculated/ruby"
|
|
5
6
|
require_relative "calculated/text"
|
|
@@ -26,6 +27,11 @@ module Entitlements
|
|
|
26
27
|
@groups_cache = {}
|
|
27
28
|
@config_cache = {}
|
|
28
29
|
|
|
30
|
+
# Group calculation shares state across groups (Entitlements.cache[:calculated], the
|
|
31
|
+
# dependency stack used for circular-reference detection, and the caches above), so only
|
|
32
|
+
# one thread may calculate at a time. Re-entrant because calculation can recurse.
|
|
33
|
+
CALCULATION_LOCK = Monitor.new
|
|
34
|
+
|
|
29
35
|
# Reset all module state
|
|
30
36
|
#
|
|
31
37
|
# Takes no arguments
|
|
@@ -63,6 +69,13 @@ module Entitlements
|
|
|
63
69
|
skip_broken_references: C::Optional[C::Bool]
|
|
64
70
|
] => C::SetOf[String]
|
|
65
71
|
def self.read_all(ou_key, cfg_obj, skip_broken_references: false)
|
|
72
|
+
CALCULATION_LOCK.synchronize { _read_all(ou_key, cfg_obj, skip_broken_references: skip_broken_references) }
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
Contract String, C::HashOf[String => C::Any], C::KeywordArgs[
|
|
76
|
+
skip_broken_references: C::Bool
|
|
77
|
+
] => C::SetOf[String]
|
|
78
|
+
def self._read_all(ou_key, cfg_obj, skip_broken_references:)
|
|
66
79
|
return read_mirror(ou_key, cfg_obj) if cfg_obj["mirror"]
|
|
67
80
|
|
|
68
81
|
@config_cache[ou_key] ||= cfg_obj
|
|
@@ -73,7 +73,7 @@ module Entitlements
|
|
|
73
73
|
# uid - Optionally a uid to return. If not specified, returns the entire hash.
|
|
74
74
|
#
|
|
75
75
|
# Returns Hash of { uid => Entitlements::Models::Person } or one Entitlements::Models::Person.
|
|
76
|
-
Contract C::Maybe[String] => C::Or[Entitlements::Models::Person,
|
|
76
|
+
Contract C::Maybe[String] => C::Or[Entitlements::Models::Person, Hash]
|
|
77
77
|
def read(uid = nil)
|
|
78
78
|
@people ||= begin
|
|
79
79
|
Entitlements.logger.debug "Loading people from #{filename.inspect}"
|
data/lib/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: entitlements-app
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GitHub, Inc. Security Ops
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: concurrent-ruby
|