coupergateway / couper

Couper is a lightweight API gateway designed to support developers in building and operating API-driven Web projects
https://couper.io
MIT License
85 stars 15 forks source link

Watching of referenced files #697

Open alex-schneider opened 1 year ago

alex-schneider commented 1 year ago

We have to watch (-watch) for referenced files in the config, e.g. openapi/file, settings/ca_file etc.

johakoch commented 1 year ago

There are three types of file attributes:

mandatory

block attribute
openapi file
saml idp_metadata_file
spa bootstrap_file

optional without alternative

block attribute
api error_file
endpoint error_file
error_handler error_file
files error_file
server error_file
settings ca_file

optional with alternative

block attribute alternative
basic_auth htpasswd_file password
certificate ca_certificate_file ca_certificate
certificate leaf_certificate_file leaf_certificate
certificate private_key_file private_key
certificate public_key_file public_key
jwt key_file key
jwt permissions_map_file permissions_map
jwt roles_map_file roles_map
jwt signing_key_file signing_key
jwt_signing_profile key_file key
tls server_ca_certificate_file server_ca_certificate
tls client_certificate_file client_certificate
tls client_private_key_file client_private_key

I'd propose to first concentrate on watching already existing file attributes, that might have their values changed, before also trying to watch newly added (or removed) optional attributes.

johakoch commented 7 months ago

I don't remember which attributes are already watched. Should we reopen this issue to implement watching to more attributes?

malud commented 7 months ago

It seems a generic implementation for all abs file refs but I am missing any test-case for this.