Currently, we only have the dst_key field to store private keys. However, in practice, dst_key can also be used to access src repositories as long as we add the corresponding public key. This violates the principle of least privilege.
Therefore, we propose a new structure with three fields: src_key, dst_key, and private_key.
src_key and dst_key are used to access the source and destination repositories respectively, each requiring its own public key. Using dst_key cannot access src, and vice versa. private_key serves as a fallback mechanism. If either src_key or dst_key is empty, data from private_key will be used. When employing private_key, it is recommended to configure separate public keys for each repository to prevent accidental access to unintended repositories due to misconfiguration.
Currently, we only have the
dst_keyfield to store private keys. However, in practice,dst_keycan also be used to access src repositories as long as we add the corresponding public key. This violates the principle of least privilege.Therefore, we propose a new structure with three fields:
src_key,dst_key, andprivate_key.src_keyanddst_keyare used to access the source and destination repositories respectively, each requiring its own public key. Usingdst_keycannot accesssrc, and vice versa.private_keyserves as a fallback mechanism. If either src_key or dst_key is empty, data fromprivate_keywill be used. When employingprivate_key, it is recommended to configure separate public keys for each repository to prevent accidental access to unintended repositories due to misconfiguration.