Renommage de "entity" en "organisation"

This commit is contained in:
Jérémy Lecour 2021-01-23 18:08:27 +01:00 committed by Jérémy Lecour
parent b65363cffd
commit 35031b0bf9
13 changed files with 165 additions and 169 deletions

View File

@ -4,7 +4,7 @@ class MetadataMappingsController < ApplicationController
# GET /metadata_mappings
# GET /metadata_mappings.json
def index
@metadata_mappings = MetadataMapping.all.order(entity: :asc, server: :asc, input: :asc)
@metadata_mappings = MetadataMapping.all.order(organisation: :asc, server: :asc, input: :asc)
end
# GET /metadata_mappings/1
@ -69,6 +69,6 @@ class MetadataMappingsController < ApplicationController
# Only allow a list of trusted parameters through.
def metadata_mapping_params
params.require(:metadata_mapping).permit(:input, :server, :entity)
params.require(:metadata_mapping).permit(:input, :server, :organisation)
end
end

View File

@ -15,7 +15,7 @@ module EmailAction
metadata_inputs = metadata_inputs(email)
metadata = metadata_mapping_class.where(input: metadata_inputs).all
email.clients = metadata.filter_map(&:entity).uniq
email.clients = metadata.filter_map(&:organisation).uniq
email.servers = metadata.filter_map(&:server).uniq
email
@ -38,7 +38,7 @@ module EmailAction
}.flatten
# add other values from headers
inputs << ["X-Client-Id", "X-Entity-Id"].filter_map { |header_name|
inputs << ["X-Client-Id", "X-Organisation-Id"].filter_map { |header_name|
email.header_values(header_name)
}.flatten.uniq

View File

@ -22,8 +22,8 @@
</div>
<div class="field">
<%= form.label :entity %>
<%= form.text_field :entity %>
<%= form.label :organisation %>
<%= form.text_field :organisation %>
</div>
<div class="actions">

View File

@ -1,2 +1,2 @@
json.extract! metadata_mapping, :id, :input, :server, :entity, :created_at, :updated_at
json.extract! metadata_mapping, :id, :input, :server, :organisation, :created_at, :updated_at
json.url metadata_mapping_url(metadata_mapping, format: :json)

View File

@ -7,7 +7,7 @@
<tr>
<th>Input</th>
<th>Server</th>
<th>Entity</th>
<th>Organisation</th>
<th colspan="3"></th>
</tr>
</thead>
@ -17,7 +17,7 @@
<tr>
<td><%= metadata_mapping.input %></td>
<td><%= metadata_mapping.server %></td>
<td><%= metadata_mapping.entity %></td>
<td><%= metadata_mapping.organisation %></td>
<td><%= link_to 'Show', metadata_mapping %></td>
<td><%= link_to 'Edit', edit_metadata_mapping_path(metadata_mapping) %></td>
<td><%= link_to 'Destroy', metadata_mapping, method: :delete, data: { confirm: 'Are you sure?' } %></td>

View File

@ -11,8 +11,8 @@
</p>
<p>
<strong>Entity:</strong>
<%= @metadata_mapping.entity %>
<strong>Organisation:</strong>
<%= @metadata_mapping.organisation %>
</p>
<%= link_to 'Edit', edit_metadata_mapping_path(@metadata_mapping) %> |

View File

@ -3,7 +3,8 @@ class CreateMetadataMappings < ActiveRecord::Migration[6.1]
create_table :metadata_mappings do |t|
t.string :input
t.string :server
t.string :entity
t.string :organisation
t.string :source, limit: 20
t.timestamps
end

View File

@ -1,5 +0,0 @@
class AddSourceToMetadataMappings < ActiveRecord::Migration[6.1]
def change
add_column :metadata_mappings, :source, :string, limit: 20
end
end

View File

@ -80,10 +80,10 @@ ActiveRecord::Schema.define(version: 2021_01_18_132809) do
create_table "metadata_mappings", force: :cascade do |t|
t.string "input"
t.string "server"
t.string "entity"
t.string "organisation"
t.string "source", limit: 20
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.string "source", limit: 20
t.index ["input"], name: "index_metadata_mappings_on_input"
end

View File

@ -7,145 +7,145 @@
# Character.create(name: 'Luke', movie: movies.first)
MetadataMapping.create([
{input: "@aixbackup01", server: "aixbackup01", entity: "evolix"},
{input: "@apparaitre", server: "apparaitre", entity: "apparaitre"},
{input: "@avancie-monitoring00", server: "avancie-monitoring00", entity: "avancie"},
{input: "@azoth-www00", server: "azoth-www00", entity: "azothsystems"},
{input: "@bebeto2", server: "bebeto2", entity: "evolix"},
{input: "@casoni", server: "casoni", entity: "evolix"},
{input: "@cleo-files1", server: "cleo-files1", entity: "cleo"},
{input: "@cloud0-source0", server: "capitaldata-cloud0-source0", entity: "capitaldata"},
{input: "@cogepart-www01", server: "cogepart-www01", entity: "cogepart"},
{input: "@componize-recovery-eu3", server: "componize-recovery-eu3", entity: "componize"},
{input: "@cybercartes-www24", server: "cybercartes-www24", entity: "cybercartes"},
{input: "@ebizproduction-confplus", server: "ebizproduction-confplus", entity: "ebizproduction"},
{input: "@edumedia", server: "edumedia", entity: "edumedia"},
{input: "@evolix.fr", server: nil, entity: "evolix"},
{input: "@exotismes-sql6", server: "exotismes-sql6", entity: "exotismes"},
{input: "@golfup", server: "golfup", entity: "golfup"},
{input: "@hbv5", server: "hbv5", entity: ""},
{input: "@hbv7", server: "hbv7", entity: ""},
{input: "@hbv8", server: "hbv8", entity: ""},
{input: "@hexacoffre", server: "hexacoffre", entity: "hexacoffre"},
{input: "@highco-prixing-www00", server: "highco-prixing-www00", entity: ""},
{input: "@highco-rmw-sas01", server: "highco-rmw-sas01", entity: ""},
{input: "@hosting05", server: "hosting05", entity: "evolix"},
{input: "@itupkeep-sql00", server: "itupkeep-sql00", entity: "itupkeep"},
{input: "@itupkeep-www10", server: "itupkeep-www10", entity: "itupkeep"},
{input: "@jobinlive-intra", server: "jobinlive-intra", entity: "jobinlive"},
{input: "@kampn-dev01", server: "kampn-dev01", entity: "kampn"},
{input: "@kampn-kvm00", server: "kampn-kvm00", entity: "kampn"},
{input: "@kampn-search-docker01", server: "kampn-search-docker01", entity: "kampn"},
{input: "@lepape-sql02", server: "lepape-sql02", entity: "lepape"},
{input: "@lepape-sql03", server: "lepape-sql03", entity: "lepape"},
{input: "@mediaaccess4", server: "mediaaccess4", entity: "mediaaccess"},
{input: "@mediaaccess-dev00", server: "mediaaccess-dev00", entity: "mediaaccess"},
{input: "@nouveauxterritoires-preprod-fcnz", server: "nouveauxterritoires-preprod-fcnz", entity: "nouveauxterritoires"},
{input: "@overcome-web2", server: "overcome-web2", entity: "overcome"},
{input: "@overcome-web3", server: "overcome-web3", entity: "overcome"},
{input: "@preprod-elk", server: "nouveauxterritoires-preprod-elk", entity: "nouveauxterritoires"},
{input: "@preprod-fcnz", server: "preprod-fcnz", entity: "nouveauxterritoiresnouveauxterritoires"},
{input: "@prodlxsas01", server: "prodlxsas01", entity: ""},
{input: "@quai13-backup3", server: "quai13-backup3", entity: "quai13"},
{input: "@quai13-www11", server: "quai13-www11", entity: "quai13"},
{input: "@quai13-www21", server: "quai13-www21", entity: "quai13"},
{input: "@sjvidil", server: "sjvidil", entity: "externmarket"},
{input: "@smsmode-sql01", server: "smsmode-sql01", entity: "smsmode"},
{input: "@socgen00", server: "socgen00", entity: "socgen"},
{input: "@spinon-www01", server: "spinon-www01", entity: "spinon"},
{input: "@stratis-www01", server: "stratis-www01", entity: "stratis"},
{input: "@stratis-www02", server: "stratis-www02", entity: "stratis"},
{input: "@tourismit-iter", server: "tourismit-iter", entity: "tourismit"},
{input: "@tyredating-yepgarage-paris-web02", server: "tyredating-yepgarage-paris-web02", entity: "tyredating"},
{input: "@tyredating-yepgarage-singapore-adm01", server: "tyredating-yepgarage-singapore-adm01", entity: "tyredating"},
{input: "@viaxoft-mrs2-sql08", server: "viaxoft-mrs2-sql08", entity: "viaxoft"},
{input: "@viaxoft-mrs2-sql08", server: nil, entity: "viaxoft"},
{input: "@viaxoft-mrs2-tomcat11", server: "viaxoft-mrs2-tomcat11", entity: "viaxoft"},
{input: "@viaxoft-mrs-tomcat05", server: "viaxoft-mrs-tomcat05", entity: ""},
{input: "@viaxoft-mrs-tomcat05", server: "viaxoft-mrs-tomcat05", entity: "viaxoft"},
{input: "@webcom-adm02", server: "webcom-adm02", entity: "webcom"},
{input: "@webcom-www05", server: "webcom-www05", entity: "webcom"},
{input: "@winnie2", server: "winnie2", entity: "evolix"},
{input: "@winnie", server: "winnie", entity: "evolix"},
{input: "@www10.quai13.net", server: "quai13-www10", entity: "quai13"},
{input: "@www11.quai13.net", server: "quai13-www11", entity: "quai13"},
{input: "@www20.quai13.net", server: "quai13-www20", entity: "quai13"},
{input: "@www21.quai13.net", server: "quai13-www21", entity: "quai13"},
{input: "Customer.Services@interxion.com", server: nil, entity: "interxion"},
{input: "alexis.chevalier@celeste.fr", server: nil, entity: "icademie"},
{input: "aubagne-glastint.com@glastint.com", server: nil, entity: "glastint"},
{input: "azothsystems@evolix.net", server: nil, entity: "azothsystems"},
{input: "@quai13-backup3", server: "quai13-backup3", entity: "quai13"},
{input: "bleucom@evolix.net", server: nil, entity: "bleucom"},
{input: "capitaldata@evolix.net", server: nil, entity: "capitaldata"},
{input: "cbathelet@si-cloud.fr", server: nil, entity: "progexia"},
{input: "cleo@evolix.net", server: nil, entity: "cleo"},
{input: "contact@coffre-fort.be", server: nil, entity: "hexacoffre"},
{input: "courriel@fub.fr", server: nil, entity: "fub"},
{input: "customer.services@interxion.com", server: nil, entity: "interxion"},
{input: "cybercartes-compta@evolix.net", server: nil, entity: "cybercartes"},
{input: "cybercartes@evolix.net", server: nil, entity: "cybercartes"},
{input: "ebizproduction@evolix.net", server: nil, entity: "ebizproduction"},
{input: "equipe@evolix.net", server: nil, entity: "evolix"},
{input: "expiry@letsencrypt.org", server: nil, entity: ""},
{input: "f.manneville@purjus.fr", server: nil, entity: "purjus"},
{input: "florajet@evolix.net", server: nil, entity: "florajet"},
{input: "fluotonic@evolix.net", server: nil, entity: "fluotonic"},
{input: "fub@evolix.net", server: nil, entity: "fub"},
{input: "guillaume.schachtele@opnsecure.com", server: nil, entity: "bazile"},
{input: "hexacoffre@evolix.net", server: nil, entity: "hexacoffre"},
{input: "icademie@evolix.net", server: nil, entity: "icademie"},
{input: "informatique@bazile.fr", server: nil, entity: "bazile"},
{input: "investprev@dpvatonline.com.br", server: nil, entity: ""},
{input: "j.ponchel@icademie.com", server: nil, entity: "icademie"},
{input: "jjobard@bazile.fr", server: nil, entity: "bazile"},
{input: "jobinlive@evolix.net", server: nil, entity: "jobinlive"},
{input: "jobintree@evolix.net", server: nil, entity: "jobintree"},
{input: "kampn-dev01.evolix.net", server: nil, entity: "kampn"},
{input: "kampn@evolix.net", server: nil, entity: "kampn"},
{input: "keyline@evolix.net", server: nil, entity: "preferendum"},
{input: "kopel@evolix.ca", server: nil, entity: "kopel"},
{input: "l2-support@franceix.net", server: nil, entity: "franceix"},
{input: "lcdr@evolix.net", server: nil, entity: "lcdr"},
{input: "lepape@evolix.net", server: nil, entity: "lepape"},
{input: "maintenance-jaguar@bazile.fr", server: nil, entity: "bazile"},
{input: "marketing-appa@apparaitre", server: "apparaitre", entity: "apparaitre"},
{input: "mediaaccess@evolix.net", server: nil, entity: "mediaaccess"},
{input: "mexico@iter", server: "tourismit-iter", entity: "tourismit"},
{input: "n.ayed@progexia.fr", server: nil, entity: "progexia"},
{input: "nicematin@evolix.net", server: nil, entity: "nicematin"},
{input: "nicolas.durut@free.fr", server: nil, entity: "cybercartes"},
{input: "no-reply@sever-admin.pw", server: nil, entity: ""},
{input: "noreply@bluewin.ch", server: nil, entity: ""},
{input: "noreply@mattermost-nouveauxterritoires.evolix.org", server: nil, entity: "nouveauxterritoires"},
{input: "nouveauxterritoires@evolix.net", server: nil, entity: "nouveauxterritoires"},
{input: "paris-bounces@members.franceix.net", server: nil, entity: "franceix"},
{input: "paris@members.franceix.net", server: nil, entity: "franceix"},
{input: "pascal.poirson@groupe-dtcf.com", server: nil, entity: "croissanceformation"},
{input: "progexia@evolix.net", server: nil, entity: "progexia"},
{input: "quai13@evolix.net", server: nil, entity: "quai13"},
{input: "redmine@evolix.net", server: nil, entity: "evolix"},
{input: "root@beauregard2.fluotonic.net", server: nil, entity: "fluotonic"},
{input: "root@cloud0-source0.kdata.fr", server: "capitaldata-cloud0-source0", entity: "capitaldata"},
{input: "root@glastint.com", server: "glastint", entity: "quai13"},
{input: "root@hbv5.hb.univ-amu.fr", server: nil, entity: ""},
{input: "root@hbv7.hb.univ-amu.fr", server: nil, entity: ""},
{input: "root@hbv8.hb.univ-amu.fr", server: nil, entity: ""},
{input: "root@kvmail0.cybercartes.com", server: "cybercartes-kvmail0", entity: "cybercartes"},
{input: "root@preprod-elk.nouveauxterritoires.net", server: "nouveauxterritoires-preprod-elk", entity: "nouveauxterritoires"},
{input: "smsmode@evolix.net", server: nil, entity: "smsmode"},
{input: "spaquin@kopel.ca", server: nil, entity: "kopel"},
{input: "stratis@evolix.net", server: nil, entity: "stratis"},
{input: "support@glastint.com", server: nil, entity: "quai13"},
{input: "support@jaguar-network.com", server: nil, entity: "jaguar"},
{input: "tech@evolix.net", server: nil, entity: "evolix"},
{input: "techlog@viaxoft.com", server: nil, entity: "viaxoft"},
{input: "tetesaclics@gmail.com", server: nil, entity: ""},
{input: "tourismit@evolix.net", server: nil, entity: "tourismit"},
{input: "tyredating-c2s@evolix.net", server: nil, entity: "tyredating"},
{input: "viaxoft-backup2.evolix.net", server: "viaxoft-backup2", entity: "viaxoft"},
{input: "viaxoft-mrs-backup2.evolix.net", server: "viaxoft-mrs-backup2", entity: "viaxoft"},
{input: "viaxoft-sys@evolix.net", server: nil, entity: "viaxoft"},
{input: "viaxoft@evolix.net", server: nil, entity: "viaxoft"},
{input: "webcom@evolix.net", server: nil, entity: "webcom"},
{input: "@aixbackup01", server: "aixbackup01", organisation: "evolix"},
{input: "@apparaitre", server: "apparaitre", organisation: "apparaitre"},
{input: "@avancie-monitoring00", server: "avancie-monitoring00", organisation: "avancie"},
{input: "@azoth-www00", server: "azoth-www00", organisation: "azothsystems"},
{input: "@bebeto2", server: "bebeto2", organisation: "evolix"},
{input: "@casoni", server: "casoni", organisation: "evolix"},
{input: "@cleo-files1", server: "cleo-files1", organisation: "cleo"},
{input: "@cloud0-source0", server: "capitaldata-cloud0-source0", organisation: "capitaldata"},
{input: "@cogepart-www01", server: "cogepart-www01", organisation: "cogepart"},
{input: "@componize-recovery-eu3", server: "componize-recovery-eu3", organisation: "componize"},
{input: "@cybercartes-www24", server: "cybercartes-www24", organisation: "cybercartes"},
{input: "@ebizproduction-confplus", server: "ebizproduction-confplus", organisation: "ebizproduction"},
{input: "@edumedia", server: "edumedia", organisation: "edumedia"},
{input: "@evolix.fr", server: nil, organisation: "evolix"},
{input: "@exotismes-sql6", server: "exotismes-sql6", organisation: "exotismes"},
{input: "@golfup", server: "golfup", organisation: "golfup"},
{input: "@hbv5", server: "hbv5", organisation: ""},
{input: "@hbv7", server: "hbv7", organisation: ""},
{input: "@hbv8", server: "hbv8", organisation: ""},
{input: "@hexacoffre", server: "hexacoffre", organisation: "hexacoffre"},
{input: "@highco-prixing-www00", server: "highco-prixing-www00", organisation: ""},
{input: "@highco-rmw-sas01", server: "highco-rmw-sas01", organisation: ""},
{input: "@hosting05", server: "hosting05", organisation: "evolix"},
{input: "@itupkeep-sql00", server: "itupkeep-sql00", organisation: "itupkeep"},
{input: "@itupkeep-www10", server: "itupkeep-www10", organisation: "itupkeep"},
{input: "@jobinlive-intra", server: "jobinlive-intra", organisation: "jobinlive"},
{input: "@kampn-dev01", server: "kampn-dev01", organisation: "kampn"},
{input: "@kampn-kvm00", server: "kampn-kvm00", organisation: "kampn"},
{input: "@kampn-search-docker01", server: "kampn-search-docker01", organisation: "kampn"},
{input: "@lepape-sql02", server: "lepape-sql02", organisation: "lepape"},
{input: "@lepape-sql03", server: "lepape-sql03", organisation: "lepape"},
{input: "@mediaaccess4", server: "mediaaccess4", organisation: "mediaaccess"},
{input: "@mediaaccess-dev00", server: "mediaaccess-dev00", organisation: "mediaaccess"},
{input: "@nouveauxterritoires-preprod-fcnz", server: "nouveauxterritoires-preprod-fcnz", organisation: "nouveauxterritoires"},
{input: "@overcome-web2", server: "overcome-web2", organisation: "overcome"},
{input: "@overcome-web3", server: "overcome-web3", organisation: "overcome"},
{input: "@preprod-elk", server: "nouveauxterritoires-preprod-elk", organisation: "nouveauxterritoires"},
{input: "@preprod-fcnz", server: "preprod-fcnz", organisation: "nouveauxterritoiresnouveauxterritoires"},
{input: "@prodlxsas01", server: "prodlxsas01", organisation: ""},
{input: "@quai13-backup3", server: "quai13-backup3", organisation: "quai13"},
{input: "@quai13-www11", server: "quai13-www11", organisation: "quai13"},
{input: "@quai13-www21", server: "quai13-www21", organisation: "quai13"},
{input: "@sjvidil", server: "sjvidil", organisation: "externmarket"},
{input: "@smsmode-sql01", server: "smsmode-sql01", organisation: "smsmode"},
{input: "@socgen00", server: "socgen00", organisation: "socgen"},
{input: "@spinon-www01", server: "spinon-www01", organisation: "spinon"},
{input: "@stratis-www01", server: "stratis-www01", organisation: "stratis"},
{input: "@stratis-www02", server: "stratis-www02", organisation: "stratis"},
{input: "@tourismit-iter", server: "tourismit-iter", organisation: "tourismit"},
{input: "@tyredating-yepgarage-paris-web02", server: "tyredating-yepgarage-paris-web02", organisation: "tyredating"},
{input: "@tyredating-yepgarage-singapore-adm01", server: "tyredating-yepgarage-singapore-adm01", organisation: "tyredating"},
{input: "@viaxoft-mrs2-sql08", server: "viaxoft-mrs2-sql08", organisation: "viaxoft"},
{input: "@viaxoft-mrs2-sql08", server: nil, organisation: "viaxoft"},
{input: "@viaxoft-mrs2-tomcat11", server: "viaxoft-mrs2-tomcat11", organisation: "viaxoft"},
{input: "@viaxoft-mrs-tomcat05", server: "viaxoft-mrs-tomcat05", organisation: ""},
{input: "@viaxoft-mrs-tomcat05", server: "viaxoft-mrs-tomcat05", organisation: "viaxoft"},
{input: "@webcom-adm02", server: "webcom-adm02", organisation: "webcom"},
{input: "@webcom-www05", server: "webcom-www05", organisation: "webcom"},
{input: "@winnie2", server: "winnie2", organisation: "evolix"},
{input: "@winnie", server: "winnie", organisation: "evolix"},
{input: "@www10.quai13.net", server: "quai13-www10", organisation: "quai13"},
{input: "@www11.quai13.net", server: "quai13-www11", organisation: "quai13"},
{input: "@www20.quai13.net", server: "quai13-www20", organisation: "quai13"},
{input: "@www21.quai13.net", server: "quai13-www21", organisation: "quai13"},
{input: "Customer.Services@interxion.com", server: nil, organisation: "interxion"},
{input: "alexis.chevalier@celeste.fr", server: nil, organisation: "icademie"},
{input: "aubagne-glastint.com@glastint.com", server: nil, organisation: "glastint"},
{input: "azothsystems@evolix.net", server: nil, organisation: "azothsystems"},
{input: "@quai13-backup3", server: "quai13-backup3", organisation: "quai13"},
{input: "bleucom@evolix.net", server: nil, organisation: "bleucom"},
{input: "capitaldata@evolix.net", server: nil, organisation: "capitaldata"},
{input: "cbathelet@si-cloud.fr", server: nil, organisation: "progexia"},
{input: "cleo@evolix.net", server: nil, organisation: "cleo"},
{input: "contact@coffre-fort.be", server: nil, organisation: "hexacoffre"},
{input: "courriel@fub.fr", server: nil, organisation: "fub"},
{input: "customer.services@interxion.com", server: nil, organisation: "interxion"},
{input: "cybercartes-compta@evolix.net", server: nil, organisation: "cybercartes"},
{input: "cybercartes@evolix.net", server: nil, organisation: "cybercartes"},
{input: "ebizproduction@evolix.net", server: nil, organisation: "ebizproduction"},
{input: "equipe@evolix.net", server: nil, organisation: "evolix"},
{input: "expiry@letsencrypt.org", server: nil, organisation: ""},
{input: "f.manneville@purjus.fr", server: nil, organisation: "purjus"},
{input: "florajet@evolix.net", server: nil, organisation: "florajet"},
{input: "fluotonic@evolix.net", server: nil, organisation: "fluotonic"},
{input: "fub@evolix.net", server: nil, organisation: "fub"},
{input: "guillaume.schachtele@opnsecure.com", server: nil, organisation: "bazile"},
{input: "hexacoffre@evolix.net", server: nil, organisation: "hexacoffre"},
{input: "icademie@evolix.net", server: nil, organisation: "icademie"},
{input: "informatique@bazile.fr", server: nil, organisation: "bazile"},
{input: "investprev@dpvatonline.com.br", server: nil, organisation: ""},
{input: "j.ponchel@icademie.com", server: nil, organisation: "icademie"},
{input: "jjobard@bazile.fr", server: nil, organisation: "bazile"},
{input: "jobinlive@evolix.net", server: nil, organisation: "jobinlive"},
{input: "jobintree@evolix.net", server: nil, organisation: "jobintree"},
{input: "kampn-dev01.evolix.net", server: nil, organisation: "kampn"},
{input: "kampn@evolix.net", server: nil, organisation: "kampn"},
{input: "keyline@evolix.net", server: nil, organisation: "preferendum"},
{input: "kopel@evolix.ca", server: nil, organisation: "kopel"},
{input: "l2-support@franceix.net", server: nil, organisation: "franceix"},
{input: "lcdr@evolix.net", server: nil, organisation: "lcdr"},
{input: "lepape@evolix.net", server: nil, organisation: "lepape"},
{input: "maintenance-jaguar@bazile.fr", server: nil, organisation: "bazile"},
{input: "marketing-appa@apparaitre", server: "apparaitre", organisation: "apparaitre"},
{input: "mediaaccess@evolix.net", server: nil, organisation: "mediaaccess"},
{input: "mexico@iter", server: "tourismit-iter", organisation: "tourismit"},
{input: "n.ayed@progexia.fr", server: nil, organisation: "progexia"},
{input: "nicematin@evolix.net", server: nil, organisation: "nicematin"},
{input: "nicolas.durut@free.fr", server: nil, organisation: "cybercartes"},
{input: "no-reply@sever-admin.pw", server: nil, organisation: ""},
{input: "noreply@bluewin.ch", server: nil, organisation: ""},
{input: "noreply@mattermost-nouveauxterritoires.evolix.org", server: nil, organisation: "nouveauxterritoires"},
{input: "nouveauxterritoires@evolix.net", server: nil, organisation: "nouveauxterritoires"},
{input: "paris-bounces@members.franceix.net", server: nil, organisation: "franceix"},
{input: "paris@members.franceix.net", server: nil, organisation: "franceix"},
{input: "pascal.poirson@groupe-dtcf.com", server: nil, organisation: "croissanceformation"},
{input: "progexia@evolix.net", server: nil, organisation: "progexia"},
{input: "quai13@evolix.net", server: nil, organisation: "quai13"},
{input: "redmine@evolix.net", server: nil, organisation: "evolix"},
{input: "root@beauregard2.fluotonic.net", server: nil, organisation: "fluotonic"},
{input: "root@cloud0-source0.kdata.fr", server: "capitaldata-cloud0-source0", organisation: "capitaldata"},
{input: "root@glastint.com", server: "glastint", organisation: "quai13"},
{input: "root@hbv5.hb.univ-amu.fr", server: nil, organisation: ""},
{input: "root@hbv7.hb.univ-amu.fr", server: nil, organisation: ""},
{input: "root@hbv8.hb.univ-amu.fr", server: nil, organisation: ""},
{input: "root@kvmail0.cybercartes.com", server: "cybercartes-kvmail0", organisation: "cybercartes"},
{input: "root@preprod-elk.nouveauxterritoires.net", server: "nouveauxterritoires-preprod-elk", organisation: "nouveauxterritoires"},
{input: "smsmode@evolix.net", server: nil, organisation: "smsmode"},
{input: "spaquin@kopel.ca", server: nil, organisation: "kopel"},
{input: "stratis@evolix.net", server: nil, organisation: "stratis"},
{input: "support@glastint.com", server: nil, organisation: "quai13"},
{input: "support@jaguar-network.com", server: nil, organisation: "jaguar"},
{input: "tech@evolix.net", server: nil, organisation: "evolix"},
{input: "techlog@viaxoft.com", server: nil, organisation: "viaxoft"},
{input: "tetesaclics@gmail.com", server: nil, organisation: ""},
{input: "tourismit@evolix.net", server: nil, organisation: "tourismit"},
{input: "tyredating-c2s@evolix.net", server: nil, organisation: "tyredating"},
{input: "viaxoft-backup2.evolix.net", server: "viaxoft-backup2", organisation: "viaxoft"},
{input: "viaxoft-mrs-backup2.evolix.net", server: "viaxoft-mrs-backup2", organisation: "viaxoft"},
{input: "viaxoft-sys@evolix.net", server: nil, organisation: "viaxoft"},
{input: "viaxoft@evolix.net", server: nil, organisation: "viaxoft"},
{input: "webcom@evolix.net", server: nil, organisation: "webcom"},
])

View File

@ -16,9 +16,9 @@ namespace :metadata_mappings do
client_name = entry[:clientevoid][0]
if client_name.present?
metadata[client_number] = {entity: client_name}
metadata[client_number] = {organisation: client_name}
entry['techmail'].each { |techmail|
metadata[techmail] = {server: nil, entity: client_name}
metadata[techmail] = {server: nil, organisation: client_name}
}
end
end
@ -30,7 +30,7 @@ namespace :metadata_mappings do
server = entry[:evocomputername][0]
if metadata.has_key?(client_number)
client_name = metadata[client_number][:entity]
client_name = metadata[client_number][:organisation]
inputs = []
if "#{entry[:dnsarecord]}."
inputs << "@#{entry[:dnsarecord][0]}"
@ -48,7 +48,7 @@ namespace :metadata_mappings do
if metadata.has_key?(input)
puts "input already found for #{input}"
else
metadata[input] = {server: server, entity: client_name}
metadata[input] = {server: server, organisation: client_name}
end
end
end
@ -57,7 +57,7 @@ namespace :metadata_mappings do
metadata.each do |input, meta|
mapping = MetadataMapping.find_or_initialize_by(input: input)
mapping.server = meta[:server]
mapping.entity = meta[:entity]
mapping.organisation = meta[:organisation]
mapping.source = :ldap
mapping.save
end

View File

@ -17,7 +17,7 @@ class MetadataMappingsControllerTest < ActionDispatch::IntegrationTest
test "should create metadata_mapping" do
assert_difference('MetadataMapping.count') do
post metadata_mappings_url, params: { metadata_mapping: { entity: @metadata_mapping.entity, input: @metadata_mapping.input, server: @metadata_mapping.server } }
post metadata_mappings_url, params: { metadata_mapping: { organisation: @metadata_mapping.organisation, input: @metadata_mapping.input, server: @metadata_mapping.server } }
end
assert_redirected_to metadata_mapping_url(MetadataMapping.last)
@ -34,7 +34,7 @@ class MetadataMappingsControllerTest < ActionDispatch::IntegrationTest
end
test "should update metadata_mapping" do
patch metadata_mapping_url(@metadata_mapping), params: { metadata_mapping: { entity: @metadata_mapping.entity, input: @metadata_mapping.input, server: @metadata_mapping.server } }
patch metadata_mapping_url(@metadata_mapping), params: { metadata_mapping: { organisation: @metadata_mapping.organisation, input: @metadata_mapping.input, server: @metadata_mapping.server } }
assert_redirected_to metadata_mapping_url(@metadata_mapping)
end

View File

@ -14,7 +14,7 @@ class MetadataMappingsTest < ApplicationSystemTestCase
visit metadata_mappings_url
click_on "New Metadata Mapping"
fill_in "Entity", with: @metadata_mapping.entity
fill_in "Organisation", with: @metadata_mapping.organisation
fill_in "Input", with: @metadata_mapping.input
fill_in "Server", with: @metadata_mapping.server
click_on "Create Metadata mapping"
@ -27,7 +27,7 @@ class MetadataMappingsTest < ApplicationSystemTestCase
visit metadata_mappings_url
click_on "Edit", match: :first
fill_in "Entity", with: @metadata_mapping.entity
fill_in "Organisation", with: @metadata_mapping.organisation
fill_in "Input", with: @metadata_mapping.input
fill_in "Server", with: @metadata_mapping.server
click_on "Update Metadata mapping"