Added explicit secrets manager write flag to Bitbucket source (#4403)

Added a field in the proto definition for Bitbucket sources to explicitly allow writing to the user's secrets manager. Initially this will be used to keep new and unused Bitbucket refresh tokens inside of the secret that we pull the config from. This process needed to happen in the first place because Bitbucket as an OAuth authorization server currently revokes any previously issued refresh tokens whenever the newest refresh token is issued with an access token, effectively making refresh tokens in the config file single-use.
This commit is contained in:
Casey Tran
2025-08-18 09:29:48 -05:00
committed by GitHub
parent ab685b0cd6
commit 9005cf9826
3 changed files with 715 additions and 700 deletions
File diff suppressed because it is too large Load Diff
+2
View File
@@ -664,6 +664,8 @@ func (m *Bitbucket) validate(all bool) error {
// no validation rules for OauthTokenEndpoint
// no validation rules for AllowSecretsManagerWrite
switch v := m.Credential.(type) {
case *Bitbucket_Token:
if v == nil {
+1
View File
@@ -116,6 +116,7 @@ message Bitbucket {
string oauth_authorization_endpoint = 10; // endpoint for OAuth authorization flow in Bitbucket Data Center application links
string oauth_token_endpoint = 11; // endpoint for getting OAuth access/refresh tokens in Bitbucket Data Center application links
repeated string oauth_scopes = 12; // list of OAuth scopes that the access token is provided
bool allow_secrets_manager_write = 13; // flag to explicitly allow TruffleHog to write to the user's secrets manager
}
message CircleCI {