fekitibi commented on issue #12170: URL: https://github.com/apache/apisix/issues/12170#issuecomment-3129424270
I'd like to take this task on and want to confirm the direction before proceeding with the implementation. ## Summary This change refactors how APISIX handles empty `deployment.admin.admin_key` values. The goal is to stop writing to the config file, generate keys in memory, and centralize the logic outside of `core.id`. ## Plan 1. **Generate Key in Memory** - If the admin key is empty, generate a random key at runtime. - Do **not** write it to `config.yaml`. 2. **Standardize Key Handling** - Whether defined in config or autogenerated, store all keys in a temporary internal structure. - This keeps key checking consistent. 3. **Logging** - If a key is autogenerated, log a warning that it will change on every restart. - Optionally log the newly generated key. 4. **Move Logic** - Move this logic out of `core.id` (which should only handle instance ID). - Suggested location: `core.authentication` or a new `core.admin_key` module. 5. **Remove Config File Writing** - Eliminate the current logic that writes back to `config.yaml`. - Avoids YAML formatting issues and unexpected changes to user config. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org