Sha256: 10d0377e3e3d3eb5a9575abc233743965d8c5dd898c6f5a33bc7781acf881984
Contents?: true
Size: 1.09 KB
Versions: 38
Compression:
Stored size: 1.09 KB
Contents
module ForestLiana class AllowedUsersGetter < UsersGetter def initialize(rendering_id) super('allowed-users', rendering_id) end def handle_service_response(response) if response.is_a?(Net::HTTPOK) body = JSON.parse(response.body) ForestLiana.allowed_users = body['data'].map do |d| user = d['attributes'] user['id'] = d['id'] user end elsif response.is_a?(Net::HTTPNotFound) FOREST_LOGGER.error "Cannot retrieve the project you\'re trying " \ "to unlock. Can you check that you properly copied the Forest " \ "env_secret in the forest_liana initializer?" elsif response.is_a?(Net::HTTPUnprocessableEntity) FOREST_LOGGER.error "Cannot retrieve any users for the project you\'re trying to " \ "unlock. Your secret key seems to be missing in your Forest configuration." [] else FOREST_LOGGER.error "Cannot retrieve any users for the project " \ "you\'re trying to unlock. An error occured in Forest API." [] end end end end
Version data entries
38 entries across 38 versions & 1 rubygems