Skip to content

Instantly share code, notes, and snippets.

@5HT
Created March 19, 2026 14:06
Show Gist options
  • Select an option

  • Save 5HT/0bed6565cfd54f1fb53a272aca1ab626 to your computer and use it in GitHub Desktop.

Select an option

Save 5HT/0bed6565cfd54f1fb53a272aca1ab626 to your computer and use it in GitHub Desktop.
pis-il.txt
%{
name: "il",
protocol: "http",
connect_timeout: 60000,
read_timeout: 60000,
retries: 5,
url: "http://api-svc.pis-il/",
write_timeout: 60000,
plugins: ref(["plugins/prometheus"]),
routes: [
%{
name: "bulk_scope",
preserve_host: false,
strip_path: false,
methods: ["GET", "OPTIONS"],
paths: ["/api/pis/bulk"],
plugins: [
plugins(
:mithril,
%{
rules: [
%{methods: ["GET"], path: "/declarations_limit", scopes: ["declaration_bulk:read_pis"]},
%{methods: ["GET"], path: "/divisions", scopes: ["division_bulk:read_pis"]},
%{methods: ["GET"], path: "/employee_roles", scopes: ["employee_role_bulk:read_pis"]},
%{methods: ["GET"], path: "/employees", scopes: ["employee_bulk:read_pis"]},
%{methods: ["GET"], path: "/healthcare_services", scopes: ["healthcare_service_bulk:read_pis"]},
%{methods: ["GET"], path: "/legal_entities", scopes: ["legal_entity_bulk:read_pis"]},
%{methods: ["GET"], path: "/parties", scopes: ["party_bulk:read_pis"]}
],
mis_only: true
}
)
]
},
%{
name: "confidant-pis-sign-in-sign-up-registration-login",
preserve_host: false,
strip_path: false,
methods: ["POST"],
paths: ["/api/pis/confidant"],
plugins: [
plugins(:mithril, %{
rules: [
%{methods: ["POST"], path: "/login(/)?$", scopes: ["confidant_person:login"]},
%{methods: ["POST"], path: "/register(/)?$", scopes: ["confidant_person:sign_up"]},
%{methods: ["POST"], path: "/sign-up(/)?$", scopes: ["trusted_confidant_person:sign_up"]},
%{methods: ["POST"], path: "/sign-in(/)?$", scopes: ["trusted_confidant_person:login"]}
]
})
]
},
%{
name: "confidant-pis-sign-up-validation",
preserve_host: false,
strip_path: false,
methods: ["POST"],
paths: ["/api/pis/confidant/sign-up_validation"],
plugins: [
plugins(:cors, [["POST"], ["*"]])
]
},
%{
name: "pis-sign-up-validation",
preserve_host: false,
strip_path: false,
methods: ["POST"],
paths: ["/api/pis/sign-up_validation"],
plugins: [
plugins(:cors, [["POST"], ["*"]])
]
},
%{
name: "pis-register",
preserve_host: false,
strip_path: false,
methods: ["POST"],
paths: ["/api/pis/register"],
plugins: [
plugins(:cors, [["POST"], ["*"]])
]
},
%{
name: "trusted-pis-sign-in",
preserve_host: false,
strip_path: false,
methods: ["POST"],
paths: ["/api/pis/sign-in"],
plugins: [
plugins(:mithril, %{rules: [%{methods: ["POST"], path: ".*", scopes: ["trusted_person:login"]}], mis_only: true})
]
},
%{
name: "trusted-pis-sign-up",
preserve_host: false,
strip_path: false,
methods: ["POST"],
paths: ["/api/pis/sign-up"],
plugins: [
plugins(:mithril, %{
rules: [%{methods: ["POST"], path: ".*", scopes: ["trusted_person:sign_up"]}],
mis_only: true
})
]
},
%{
name: "apps_scope",
preserve_host: false,
strip_path: false,
methods: ["GET", "DELETE"],
paths: ["/api/pis/apps"],
plugins: [
plugins(:mithril, %{
rules: [
%{methods: ["GET"], path: "(/#{uuid}(/)?$|^(/)?$)", scopes: ["app:read_pis"]},
%{methods: ["DELETE"], path: "/#{uuid}(/)?$", scopes: ["app:delete_pis"]}
]
})
]
},
%{
name: "documents_scope",
preserve_host: false,
strip_path: false,
methods: ["POST", "PATCH", "OPTIONS"],
paths: ["/api/pis/documents"],
plugins: [
plugins(:mithril, %{
rules: [
%{methods: ["POST"], path: ".*", scopes: ["person_documents:write_pis"]},
%{methods: ["PATCH"], path: "/actions/complete", scopes: ["person_documents:write_pis"]}
]
})
]
},
%{
name: "get-dictionaries",
preserve_host: false,
strip_path: false,
methods: ["GET", "OPTIONS"],
paths: ["/api/dictionaries"],
plugins: [
plugins(:cors, [["GET"], ["*"], false, ["location"]])
]
},
%{
name: "authentication_method_requests",
preserve_host: false,
strip_path: false,
methods: ["POST", "PATCH"],
paths: ["/api/pis/authentication_method_requests"],
plugins: [
plugins(:mithril, %{
rules: [
%{methods: ["POST"], path: ".*", scopes: ["authentication_method_request:write_pis"]},
%{
methods: ["PATCH"],
path: "/#{uuid}/actions/approve(/)?$",
scopes: ["authentication_method_request:write_pis"]
},
%{
methods: ["POST"],
path: "/#{uuid}/actions/resend_otp(/)?$",
scopes: ["authentication_method_request:write_pis"]
}
]
})
]
},
%{
name: "authentication_methods",
preserve_host: false,
strip_path: false,
methods: ["PATCH"],
paths: ["/api/pis/authentication_methods"],
plugins: [
plugins(:mithril, %{
rules: [
%{
methods: ["PATCH"],
path: "/#{uuid}/actions/deactivate(/)?$",
scopes: ["authentication_method:deactivate_pis"]
},
%{methods: ["PATCH"], path: "/#{uuid}(/)?$", scopes: ["authentication_method:write_pis"]}
]
})
]
},
%{
name: "declarations",
preserve_host: false,
strip_path: false,
methods: ["GET", "PATCH", "OPTIONS"],
paths: ["/api/pis/declarations"],
plugins: [
plugins(:mithril, %{
rules: [
%{methods: ["GET"], path: "(/)?$", scopes: ["declaration:read_pis"]},
%{methods: ["GET"], path: "/#{uuid}(/)?$", scopes: ["declaration:details_pis"]},
%{methods: ["PATCH"], path: "/#{uuid}/actions/terminate(/)?$", scopes: ["declaration:terminate_pis"]}
]
})
]
},
%{
name: "declaration-requests",
preserve_host: false,
strip_path: false,
methods: ["GET", "POST", "PATCH", "OPTIONS"],
paths: ["/api/pis/declaration_requests"],
plugins: [
plugins(:mithril, %{
rules: [
%{methods: ["GET"], path: "(/)?$", scopes: ["declaration_request:read_pis"]},
%{methods: ["GET"], path: "/#{uuid}(/)?$", scopes: ["declaration_request:details_pis"]},
%{methods: ["POST"], path: ".*", scopes: ["declaration_request:write_pis"]},
%{methods: ["PATCH"], path: "/#{uuid}/actions/sign(/)?$", scopes: ["declaration_request:sign_pis"]},
%{methods: ["PATCH"], path: "/#{uuid}/actions/reject(/)?$", scopes: ["declaration_request:reject_pis"]}
]
})
]
},
%{
name: "person_scope",
preserve_host: false,
strip_path: false,
methods: ["GET", "OPTIONS"],
paths: ["/api/pis/person"],
plugins: [
plugins(:mithril, %{
rules: [
%{methods: ["GET"], path: ".*", scopes: ["person:details_pis"]},
%{methods: ["GET"], path: "/verification", scopes: ["person_verification:details_pis"]},
%{methods: ["GET"], path: "/authentication_methods", scopes: ["authentication_method:read_pis"]}
]
})
]
},
%{
name: "get-user-profile",
preserve_host: false,
strip_path: false,
methods: ["GET", "OPTIONS"],
paths: ["/api/profile(/)?$"],
plugins: [
plugins(:cors, [["GET"], ["https://my.ehealth.gov.ua", "https://pis-auth.ehealth.gov.ua"], true]),
plugins(:mithril, %{rules: [%{methods: ["GET"], path: ".*", scopes: ["profile:read"]}]})
]
},
%{
name: "person_requests_scope",
preserve_host: false,
strip_path: false,
methods: ["GET", "POST", "PATCH", "OPTIONS"],
paths: ["/api/pis/person_requests"],
plugins: [
plugins(:mithril, %{
rules: [
%{methods: ["GET"], path: "(/)?$", scopes: ["person_request:read_pis"]},
%{methods: ["GET"], path: "/#{uuid}(/)?$", scopes: ["person_request:details_pis"]},
%{methods: ["POST"], path: "(/)?$", scopes: ["person_request:write_pis"]},
%{methods: ["PATCH"], path: "/#{uuid}/actions/reject(/)?$", scopes: ["person_request:reject_pis"]},
%{methods: ["PATCH"], path: "/#{uuid}/actions/complete(/)?$", scopes: ["person_request:write_pis"]}
]
})
]
},
%{
name: "trusted-person-requests-scope",
preserve_host: false,
strip_path: false,
methods: ["POST"],
paths: ["/api/pis/trusted/person_requests"],
plugins: [
plugins(:mithril, %{rules: [%{methods: ["POST"], path: "(/)?$", scopes: ["person_request:write_pis"]}]})
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment