Skip to content

Commit

Permalink
Merge pull request #240 from overmindtech/hcp
Browse files Browse the repository at this point in the history
Endpoints for HCP Terraform integration
  • Loading branch information
DavidS-ovm authored Aug 1, 2024
2 parents 4953ae5 + 2195044 commit 2712d72
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
File renamed without changes.
41 changes: 41 additions & 0 deletions config.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
syntax = "proto3";

package config;

import "apikeys.proto";

option go_package = "github.com/overmindtech/sdp-go;sdp";

// a simple key-value store to store configuration data for accounts and users (TODO)
Expand All @@ -9,6 +12,15 @@ service ConfigurationService {
rpc GetAccountConfig(GetAccountConfigRequest) returns (GetAccountConfigResponse);
// Update the account config for the user's account
rpc UpdateAccountConfig(UpdateAccountConfigRequest) returns (UpdateAccountConfigResponse);

// Create a new HCP Terraform config for the user's account. This follows
// the same flow as CreateAPIKey, to create a new API key that is then used
// for the HCP Terraform endpoint URL.
rpc CreateHcpConfig(CreateHcpConfigRequest) returns (CreateHcpConfigResponse);
// Get the existing HCP Terraform config for the user's account.
rpc GetHcpConfig(GetHcpConfigRequest) returns (GetHcpConfigResponse);
// Remove the existing HCP Terraform config from the user's account.
rpc DeleteHcpConfig(DeleteHcpConfigRequest) returns (DeleteHcpConfigResponse);
}

// The config that is used when calculating the blast radius for a change, this
Expand Down Expand Up @@ -67,3 +79,32 @@ message UpdateAccountConfigRequest {
message UpdateAccountConfigResponse {
AccountConfig config = 1;
}

message CreateHcpConfigRequest {
// The URL that the user should be redirected to after the whole process is
// over. This should be a page in the frontend, probably the HCP Terraform
// Integration page.
string finalFrontendRedirect = 1;
}

message CreateHcpConfigResponse {
HcpConfig config = 1;
apikeys.CreateAPIKeyResponse apiKey = 2;
}

message HcpConfig {
// the Endpoint URL for the HCP Run Task configuration
string endpoint = 1;
// the HMAC secret for the HCP Run Task configuration
string secret = 2;
}

message GetHcpConfigRequest {}

message GetHcpConfigResponse {
HcpConfig config = 1;
}

message DeleteHcpConfigRequest {}

message DeleteHcpConfigResponse {}

0 comments on commit 2712d72

Please sign in to comment.