Skip to content

Commit

Permalink
feat: Add Bitbucket Data Center Config and Bitbucket Cloud config for…
Browse files Browse the repository at this point in the history
… Cloud Build Repositories

PiperOrigin-RevId: 615470832
  • Loading branch information
Google APIs authored and Copybara-Service committed Mar 13, 2024
1 parent 6a03ea3 commit 98cbc7d
Showing 1 changed file with 79 additions and 2 deletions.
81 changes: 79 additions & 2 deletions google/devtools/cloudbuild/v2/repositories.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/httpbody.proto";
import "google/api/resource.proto";
import "google/devtools/cloudbuild/v2/cloudbuild.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
Expand Down Expand Up @@ -198,8 +199,8 @@ service RepositoryManager {
}
}

// A connection to a SCM like GitHub, GitHub Enterprise, Bitbucket Server or
// GitLab.
// A connection to a SCM like GitHub, GitHub Enterprise, Bitbucket Data Center,
// Bitbucket Cloud or GitLab.
message Connection {
option (google.api.resource) = {
type: "cloudbuild.googleapis.com/Connection"
Expand Down Expand Up @@ -232,6 +233,12 @@ message Connection {
// Configuration for connections to gitlab.com or an instance of GitLab
// Enterprise.
GitLabConfig gitlab_config = 7;

// Configuration for connections to Bitbucket Data Center.
BitbucketDataCenterConfig bitbucket_data_center_config = 8;

// Configuration for connections to Bitbucket Cloud.
BitbucketCloudConfig bitbucket_cloud_config = 9;
}

// Output only. Installation state of the Connection.
Expand Down Expand Up @@ -414,6 +421,76 @@ message GitLabConfig {
string server_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Configuration for connections to Bitbucket Data Center.
message BitbucketDataCenterConfig {
// Required. The URI of the Bitbucket Data Center instance or cluster this
// connection is for.
string host_uri = 1 [(google.api.field_behavior) = REQUIRED];

// Required. Immutable. SecretManager resource containing the webhook secret
// used to verify webhook events, formatted as
// `projects/*/secrets/*/versions/*`.
string webhook_secret_secret_version = 2 [
(google.api.field_behavior) = REQUIRED,
(google.api.field_behavior) = IMMUTABLE,
(google.api.resource_reference) = {
type: "secretmanager.googleapis.com/SecretVersion"
}
];

// Required. A http access token with the `REPO_READ` access.
UserCredential read_authorizer_credential = 3
[(google.api.field_behavior) = REQUIRED];

// Required. A http access token with the `REPO_ADMIN` scope access.
UserCredential authorizer_credential = 4
[(google.api.field_behavior) = REQUIRED];

// Optional. Configuration for using Service Directory to privately connect to
// a Bitbucket Data Center. This should only be set if the Bitbucket Data
// Center is hosted on-premises and not reachable by public internet. If this
// field is left empty, calls to the Bitbucket Data Center will be made over
// the public internet.
ServiceDirectoryConfig service_directory_config = 5
[(google.api.field_behavior) = OPTIONAL];

// Optional. SSL certificate to use for requests to the Bitbucket Data Center.
string ssl_ca = 6 [(google.api.field_behavior) = OPTIONAL];

// Output only. Version of the Bitbucket Data Center running on the
// `host_uri`.
string server_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Configuration for connections to Bitbucket Cloud.
message BitbucketCloudConfig {
// Required. The Bitbucket Cloud Workspace ID to be connected to Google Cloud
// Platform.
string workspace = 1 [(google.api.field_behavior) = REQUIRED];

// Required. SecretManager resource containing the webhook secret used to
// verify webhook events, formatted as `projects/*/secrets/*/versions/*`.
string webhook_secret_secret_version = 2 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "secretmanager.googleapis.com/SecretVersion"
}
];

// Required. An access token with the `repository` access. It can be either a
// workspace, project or repository access token. It's recommended to use a
// system account to generate the credentials.
UserCredential read_authorizer_credential = 3
[(google.api.field_behavior) = REQUIRED];

// Required. An access token with the `webhook`, `repository`,
// `repository:admin` and `pullrequest` scope access. It can be either a
// workspace, project or repository access token. It's recommended to use a
// system account to generate these credentials.
UserCredential authorizer_credential = 4
[(google.api.field_behavior) = REQUIRED];
}

// ServiceDirectoryConfig represents Service Directory configuration for a
// connection.
message ServiceDirectoryConfig {
Expand Down

0 comments on commit 98cbc7d

Please sign in to comment.