forest_admin_agent 1.12.15 → 1.12.16
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: ef78c2e321cc6bf9f5c08237f9f3cee7b47844047b81fd23d0ecf6e19bc96dd5
         | 
| 4 | 
            +
              data.tar.gz: f96dcb145c4622164c8ec9d49a79d0fcd97aa1b898c8e48b1034fd3f65aa498b
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: b8a6a19c4068913b44af6dd8c9c94d2474f874314b604b2960431f7200510fa82ef8d114cf17eb29ed964cae0b75e899e800cf4f7c04d0cad88897de1d6d7fcc
         | 
| 7 | 
            +
              data.tar.gz: 6998491c62ee7a225f73c9fb96e52c00245e60d4cd21e2f9c08b7b2a10db5f3b6adef68c755c82eb848c6ccbd54483b7582c8bbe1ffe43c6a06c93b68005af70
         | 
| @@ -1,5 +1,4 @@ | |
| 1 1 | 
             
            require 'dry-container'
         | 
| 2 | 
            -
            require 'filecache'
         | 
| 3 2 | 
             
            require 'json'
         | 
| 4 3 |  | 
| 5 4 | 
             
            module ForestAdminAgent
         | 
| @@ -10,8 +9,6 @@ module ForestAdminAgent | |
| 10 9 | 
             
                  include ForestAdminAgent::Http::Exceptions
         | 
| 11 10 | 
             
                  include ForestAdminDatasourceToolkit::Exceptions
         | 
| 12 11 |  | 
| 13 | 
            -
                  TTL_SCHEMA = 7200
         | 
| 14 | 
            -
             | 
| 15 12 | 
             
                  attr_reader :customizer, :container, :has_env_secret
         | 
| 16 13 |  | 
| 17 14 | 
             
                  def setup(options)
         | 
| @@ -137,11 +134,6 @@ module ForestAdminAgent | |
| 137 134 | 
             
                    if should_send || force
         | 
| 138 135 | 
             
                      client = ForestAdminAgent::Http::ForestAdminApiRequester.new
         | 
| 139 136 | 
             
                      client.post('/forest/apimaps', api_map.to_json)
         | 
| 140 | 
            -
                      schema_file_hash_cache = FileCache.new('app', @options[:cache_dir].to_s, TTL_SCHEMA)
         | 
| 141 | 
            -
                      schema_file_hash_cache.get_or_set 'value' do
         | 
| 142 | 
            -
                        api_map[:meta][:schemaFileHash]
         | 
| 143 | 
            -
                      end
         | 
| 144 | 
            -
                      @container.register(:schema_file_hash, schema_file_hash_cache)
         | 
| 145 137 | 
             
                      ForestAdminAgent::Facades::Container.logger.log('Info', 'schema was updated, sending new version')
         | 
| 146 138 | 
             
                    else
         | 
| 147 139 | 
             
                      @container.resolve(:logger)
         | 
| @@ -172,16 +164,11 @@ module ForestAdminAgent | |
| 172 164 | 
             
                  end
         | 
| 173 165 |  | 
| 174 166 | 
             
                  def build_cache
         | 
| 175 | 
            -
                    @container.register(:cache, FileCache.new('app', @options[:cache_dir].to_s, TTL_SCHEMA))
         | 
| 176 | 
            -
                    return unless @has_env_secret
         | 
| 177 | 
            -
             | 
| 178 | 
            -
                    cache = @container.resolve(:cache)
         | 
| 179 | 
            -
             | 
| 180 167 | 
             
                    @options[:customize_error_message] =
         | 
| 181 168 | 
             
                      clean_option_value(@options[:customize_error_message], 'config.customize_error_message =')
         | 
| 182 169 | 
             
                    @options[:logger] = clean_option_value(@options[:logger], 'config.logger =')
         | 
| 183 170 |  | 
| 184 | 
            -
                     | 
| 171 | 
            +
                    @container.register(:config, @options.to_h)
         | 
| 185 172 | 
             
                  end
         | 
| 186 173 |  | 
| 187 174 | 
             
                  def build_logger
         | 
| @@ -16,13 +16,14 @@ module ForestAdminAgent | |
| 16 16 | 
             
                  end
         | 
| 17 17 |  | 
| 18 18 | 
             
                  def self.config_from_cache
         | 
| 19 | 
            -
                    instance.resolve(: | 
| 19 | 
            +
                    instance.resolve(:config)
         | 
| 20 20 | 
             
                  end
         | 
| 21 21 |  | 
| 22 22 | 
             
                  def self.cache(key)
         | 
| 23 | 
            -
                     | 
| 23 | 
            +
                    config = config_from_cache
         | 
| 24 | 
            +
                    raise "Key #{key} not found in config" unless config.key?(key)
         | 
| 24 25 |  | 
| 25 | 
            -
                     | 
| 26 | 
            +
                    config[key]
         | 
| 26 27 | 
             
                  end
         | 
| 27 28 | 
             
                end
         | 
| 28 29 | 
             
              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.12. | 
| 4 | 
            +
              version: 1.12.16
         | 
| 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: 2025-10- | 
| 12 | 
            +
            date: 2025-10-30 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: activesupport
         |