Skip to content

Commit

Permalink
Introduce multi files for authorization definitions
Browse files Browse the repository at this point in the history
Migrate generators too
  • Loading branch information
skelz0r committed Dec 12, 2024
1 parent 7e09fa3 commit 8759b5f
Show file tree
Hide file tree
Showing 11 changed files with 765 additions and 772 deletions.
4 changes: 2 additions & 2 deletions app/models/authorization_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class AuthorizationDefinition < StaticApplicationRecord
:public

def self.all
Rails.application.config_for(:authorization_definitions).map do |uid, hash|
build(uid, hash)
AuthorizationDefinitionConfigurations.instance.all.map do |uid, hash|
build(uid, hash.deep_symbolize_keys)
end
end

Expand Down
5 changes: 5 additions & 0 deletions app/services/authorization_definition_configurations.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AuthorizationDefinitionConfigurations < AbstractYAMLConfiguration
def files
Dir[Rails.root.join('config/authorization_definitions/*.y*ml').to_s]
end
end
675 changes: 0 additions & 675 deletions config/authorization_definitions.yml

This file was deleted.

43 changes: 43 additions & 0 deletions config/authorization_definitions/api_opale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
api_opale_sandbox:
name: API OPALE
description: "FEEDME"
provider: "dgfip"
kind: 'api'
link: "https://api-opale.gouv.fr/feedme-with-valid-url"
cgu_link: "/public/cgus/dgfip/cgu_bas_opale_v.2023_11.pdf"
access_link: "https://api-opale.gouv.fr/tokens/%<external_provider_id>"
public: false
stage:
type: sandbox
next:
id: api_opale
form_id: api-opale-production
blocks:
- name: basic_infos
- name: personal_data
- name: legal
- name: contacts

api_opale:
name: API OPALE
description: "FEEDME"
provider: "dgfip"
kind: 'api'
link: "https://api-opale.gouv.fr/feedme-with-valid-url"
cgu_link: "/public/cgus/dgfip/cgu_prod_opale_v.2023_11.pdf"
access_link: "https://api-opale.gouv.fr/tokens/%<external_provider_id>"
public: false
stage:
type: production
previouses:
- id: api_opale_sandbox
form_id: api-opale-sandbox
blocks:
- name: basic_infos
- name: personal_data
- name: legal
- name: contacts
- name: operational_acceptance
- name: safety_certification
- name: volumetrie

Loading

0 comments on commit 8759b5f

Please sign in to comment.