apolloconfig / apollo

Apollo is a reliable configuration management system suitable for microservice configuration management scenarios.
https://www.apolloconfig.com
Apache License 2.0
28.93k stars 10.19k forks source link

1.8.0,接入一个app.id 使用多个namespace的时候,多个namesapce均开启了accesskey.sercet,这时候接入的配置代码要怎么写呢 #5128

Closed mickyss closed 2 months ago

mickyss commented 2 months ago

apollo.accesskey.sercet= 这个可以直接支持多个秘钥吗

还是只能用 apollo.accesskey.namespace1= xx apollo.accesskey.namespace2= xx 自己在读取的时候填写对应的key,

thanks

dosubot[bot] commented 2 months ago

In Apollo version 1.8.0, to support multiple accesskey.secret values for different namespaces, you need to specify an access key for each namespace individually. Apollo does not support using a single property like apollo.accesskey.secret= for multiple secrets. Instead, you should configure each namespace with its own access key in the Apollo admin system and then manage the mapping between namespaces and their respective access keys in your application. This involves:

  1. Configuring each namespace with its own access key in Apollo's admin system.
  2. Managing the mapping between namespaces and their access keys in your application, which could be through configuration files, environment variables, or a database.
  3. Modifying your application logic to use the correct access key based on the namespace it is interacting with.

Access keys are managed on a per-application (or namespace) basis in Apollo, with a unique accesskey.secret generated for each access key. This setup requires you to handle the access keys manually in your code or configuration management setup, ensuring the correct access key is used for the appropriate namespace.

Sources

#### About Dosu This response is meant to be useful and save you time. It is **not meant to be a precise solution**, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot.
mickyss commented 2 months ago

好的,谢谢您

bigbigbo commented 2 months ago

学习到了