forest_admin_agent 1.0.0.pre.beta.43 → 1.0.0.pre.beta.45

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: 0635abd1d4c76ee63ba9b736d36aba872c71edd1e7b0b302f4e564b37642e855
4
- data.tar.gz: a0991ae3cce732cd2ba7c9effe50608d42e58a5db971e64199adc810234b44d9
3
+ metadata.gz: 9d61e45333bea735ec3c47b19b761f8081bc6bf3cb7e78f2df61ed43eecf4ce9
4
+ data.tar.gz: 833560b6f78019008a1f7c8dd8a640b65cb1870ae7f341a10d22986d244bc300
5
5
  SHA512:
6
- metadata.gz: 54fa3a264a003fa877cba87f2c815f89b15cf9e7a984a1653c4a5276f237c6de73f84e4e1f359c38bc4bb914e9352a5d6d3f9fb56a47949d3697205926806079
7
- data.tar.gz: eaf48bb97a7d1fb16f837735fece8759581c34ea3fb2beec03fbcb52691d013bcdbff84fcb4b70af8fbd98c7d5410460bfec2942f9a9398c46543da1ace0dda9
6
+ metadata.gz: 00a941a6b5c3417233a5a141451d145282e4a1dd6765dd782742d886ed8f10eadea02cdcb92285f614f6c04deb6b1359a43ba2ae2f286f110bde6f8ebf717d04
7
+ data.tar.gz: 07db816bfdc85d3228f11515a4e9ba56be78425b6cba049176f837c72e3555cc325cc5481409ef302eadc81781efcad44d9648a1dcc7e363df39ab2cd3eef12e
@@ -49,7 +49,6 @@ module ForestAdminAgent
49
49
  @container.resolve(:schema_file_hash).get('value') == schema[:meta][:schemaFileHash]
50
50
 
51
51
  if !schema_is_know || force
52
- # Logger::log('Info', 'schema was updated, sending new version');
53
52
  client = ForestAdminAgent::Http::ForestAdminApiRequester.new
54
53
  client.post('/forest/apimaps', schema.to_json)
55
54
  schema_file_hash_cache = FileCache.new('app', @options[:cache_dir].to_s, TTL_SCHEMA)
@@ -57,9 +56,10 @@ module ForestAdminAgent
57
56
  schema[:meta][:schemaFileHash]
58
57
  end
59
58
  @container.register(:schema_file_hash, schema_file_hash_cache)
59
+ ForestAdminAgent::Facades::Container.logger.log('Info', 'schema was updated, sending new version')
60
60
  else
61
61
  @container.resolve(:logger)
62
- # TODO: Logger::log('Info', 'Schema was not updated since last run');
62
+ ForestAdminAgent::Facades::Container.logger.log('Info', 'Schema was not updated since last run')
63
63
  end
64
64
  end
65
65
 
@@ -32,8 +32,7 @@ module ForestAdminAgent
32
32
 
33
33
  cache.delete(id_cache) unless cache.get(id_cache).nil?
34
34
 
35
- # TODO: HANDLE LOGGER
36
- # logger.debug("Invalidating #{id_cache} cache..")
35
+ ForestAdminAgent::Facades::Container.logger.log('Info', "Invalidating #{id_cache} cache..")
37
36
  end
38
37
 
39
38
  def can?(action, collection, allow_fetch: false)
@@ -66,13 +65,17 @@ module ForestAdminAgent
66
65
 
67
66
  # still not allowed - throw forbidden message
68
67
  unless is_allowed
69
- # TODO: HANDLE LOGGER
70
- # logger.debug("User #{caller.id} cannot retrieve chart on rendering #{caller.rendering_id}")
68
+ ForestAdminAgent::Facades::Container.logger.log(
69
+ 'Debug',
70
+ "User #{caller.id} cannot retrieve chart on rendering #{caller.rendering_id}"
71
+ )
71
72
  raise ForbiddenError, "You don't have permission to access this collection."
72
73
  end
73
74
 
74
- # TODO: HANDLE LOGGER
75
- # logger.debug("User #{caller.id} can retrieve chart on rendering #{caller.rendering_id}")
75
+ ForestAdminAgent::Facades::Container.logger.log(
76
+ 'Debug',
77
+ "User #{caller.id} can retrieve chart on rendering #{caller.rendering_id}"
78
+ )
76
79
 
77
80
  is_allowed
78
81
  end
@@ -93,8 +96,10 @@ module ForestAdminAgent
93
96
  )
94
97
 
95
98
  smart_action_approval.can_execute?
96
- # TODO: HANDLE LOGGER
97
- # logger.debug("User #{user_data[:roleId]} is #{is_allowed ? '' : 'not'} allowed to perform #{action['name']}")
99
+ ForestAdminAgent::Facades::Container.logger.log(
100
+ 'Debug',
101
+ "User #{user_data[:roleId]} is #{is_allowed ? "" : "not"} allowed to perform #{action["name"]}"
102
+ )
98
103
  end
99
104
 
100
105
  def get_scope(collection)
@@ -120,8 +125,7 @@ module ForestAdminAgent
120
125
  users[user[:id].to_s] = user
121
126
  end
122
127
 
123
- # TODO: HANDLE LOGGER
124
- # logger.debug('Refreshing user permissions cache')
128
+ ForestAdminAgent::Facades::Container.logger.log('Debug', 'Refreshing user permissions cache')
125
129
 
126
130
  users
127
131
  end[user_id.to_s]
@@ -146,8 +150,7 @@ module ForestAdminAgent
146
150
  collections[name] = decode_crud_permissions(collection).merge(decode_action_permissions(collection))
147
151
  end
148
152
 
149
- # TODO: HANDLE LOGGER
150
- # logger.debug('Fetching environment permissions')
153
+ ForestAdminAgent::Facades::Container.logger.log('Debug', 'Fetching environment permissions')
151
154
 
152
155
  collections
153
156
  end
@@ -164,8 +167,10 @@ module ForestAdminAgent
164
167
  stat_hash << "#{stat[:type]}:#{array_hash(stat)}"
165
168
  end
166
169
 
167
- # TODO: HANDLE LOGGER
168
- # logger.debug("Loading rendering permissions for rendering #{rendering_id}")
170
+ ForestAdminAgent::Facades::Container.logger.log(
171
+ 'Debug',
172
+ "Loading rendering permissions for rendering #{rendering_id}"
173
+ )
169
174
 
170
175
  stat_hash
171
176
  end
@@ -7,7 +7,7 @@ module ForestAdminAgent
7
7
  class SchemaEmitter
8
8
  LIANA_NAME = "forest-rails"
9
9
 
10
- LIANA_VERSION = "1.0.0-beta.43"
10
+ LIANA_VERSION = "1.0.0-beta.45"
11
11
 
12
12
  def self.get_serialized_schema(datasource)
13
13
  schema_path = Facades::Container.cache(:schema_path)
@@ -15,7 +15,11 @@ module ForestAdminAgent
15
15
  schema = if schema_path && File.exist?(schema_path)
16
16
  JSON.parse(File.read(schema_path), { symbolize_names: true })
17
17
  else
18
- # TODO: Logger::log('Warn', 'The .forestadmin-schema.json file doesn\'t exist')
18
+ ForestAdminAgent::Facades::Container.logger.log(
19
+ 'Warn',
20
+ 'The .forestadmin-schema.json file doesn\'t exist'
21
+ )
22
+
19
23
  {
20
24
  meta: meta(Digest::SHA1.hexdigest('')),
21
25
  collections: {}
@@ -1,3 +1,3 @@
1
1
  module ForestAdminAgent
2
- VERSION = "1.0.0-beta.43"
2
+ VERSION = "1.0.0-beta.45"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_admin_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.beta.43
4
+ version: 1.0.0.pre.beta.45
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthieu
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2024-04-12 00:00:00.000000000 Z
12
+ date: 2024-05-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport