forked from kenzuya/unshackle
feat(remote): accept serve.users keys in api-only mode and add client auth-header fallback
api-only/remote-only serve now authenticates every serve.users key (str-coerced), not just api_secret, so per-user service allowlists apply. RemoteClient tries X-Secret-Key then X-Api-Key on 401 (sticky winner); remote_services.auth_headers prepends extra header names to the defaults.
This commit is contained in:
@@ -204,8 +204,8 @@ class Services(click.Group):
|
||||
from unshackle.core.remote_service import RemoteClient, resolve_server
|
||||
|
||||
server_name = ctx.params.get("server")
|
||||
server_url, api_key, _ = resolve_server(server_name)
|
||||
client = RemoteClient(server_url, api_key)
|
||||
server_url, api_key, services_config = resolve_server(server_name)
|
||||
client = RemoteClient(server_url, api_key, services_config.get("_auth_headers"))
|
||||
result = client.get("/api/services")
|
||||
Services._remote_services_cache = result.get("services", [])
|
||||
return Services._remote_services_cache
|
||||
|
||||
Reference in New Issue
Block a user