Skip to content

Commit c0fc47b

Browse files
authored
feat: [PL-58641]: oidc support for gcp sm and kms (#633)
* feat: [PL-58641]: oidc support for gcp sm and kms * feat: [PL-58641]: add oidc support for gcp sm and gcp kms * feat: [PL-58641]: add oidc support for gcp sm and gcp kms
1 parent 2596cc5 commit c0fc47b

8 files changed

+97
-8
lines changed

harness/nextgen/model_connector_info.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ type ConnectorInfo struct {
4848
Dynatrace *DynatraceConnectorDto `json:"-"`
4949
Gcp *GcpConnector `json:"-"`
5050
GcpCloudCost *GcpCloudCostConnectorDto `json:"-"`
51+
GcpKms *GcpKmsConnector `json:"-"`
5152
Git *GitConfig `json:"-"`
5253
Github *GithubConnector `json:"-"`
5354
Gitlab *GitlabConnector `json:"-"`

harness/nextgen/model_connector_info_serializer.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ func (a *ConnectorInfo) UnmarshalJSON(data []byte) error {
9191
err = json.Unmarshal(aux.Spec, &a.SumoLogic)
9292
case ConnectorTypes.GcpSecretManager:
9393
err = json.Unmarshal(aux.Spec, &a.GcpSecretManager)
94+
case ConnectorTypes.GcpKms:
95+
err = json.Unmarshal(aux.Spec, &a.GcpKms)
9496
case ConnectorTypes.Spot:
9597
err = json.Unmarshal(aux.Spec, &a.Spot)
9698
case ConnectorTypes.ServiceNow:
@@ -191,6 +193,8 @@ func (a *ConnectorInfo) MarshalJSON() ([]byte, error) {
191193
spec, err = json.Marshal(a.SumoLogic)
192194
case ConnectorTypes.GcpSecretManager:
193195
spec, err = json.Marshal(a.GcpSecretManager)
196+
case ConnectorTypes.GcpKms:
197+
spec, err = json.Marshal(a.GcpKms)
194198
case ConnectorTypes.Spot:
195199
spec, err = json.Marshal(a.Spot)
196200
case ConnectorTypes.ServiceNow:

harness/nextgen/model_gcp_kms_connector.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,15 @@ type GcpKmsConnector struct {
1818
// Name of the Key Ring where Google Cloud Symmetric Key is created.
1919
KeyRing string `json:"keyRing"`
2020
// Name of the Google Cloud Symmetric Key.
21-
KeyName string `json:"keyName"`
22-
Credentials string `json:"credentials"`
21+
KeyName string `json:"keyName"`
22+
// File Secret which is Service Account Key.
23+
Credentials string `json:"credentials,omitempty"`
2324
// List of Delegate Selectors that belong to the same Delegate and are used to connect to the Secret Manager.
24-
DelegateSelectors []string `json:"delegateSelectors,omitempty"`
25-
Default_ bool `json:"default,omitempty"`
25+
DelegateSelectors []string `json:"delegateSelectors,omitempty"`
26+
OidcDetails *GcpOidcDetails `json:"oidcDetails,omitempty"`
27+
IgnoreTestConnection bool `json:"ignoreTestConnection,omitempty"`
28+
// Should the secret manager execute operations on the delegate, or via Harness platform
29+
ExecuteOnDelegate bool `json:"executeOnDelegate"`
30+
Default_ bool `json:"default"`
31+
ConnectorType string `json:"connectorType"`
2632
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Harness NextGen Software Delivery Platform API Reference
3+
*
4+
* This is the Open Api Spec 3 for the NextGen Manager. This is under active development. Beware of the breaking change with respect to the generated code stub
5+
*
6+
* API version: 3.0
7+
* Contact: contact@harness.io
8+
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
9+
*/
10+
package nextgen
11+
12+
type GcpOidcTokenExchangeDetailsForDelegate struct {
13+
OidcIdToken string `json:"oidcIdToken,omitempty"`
14+
OidcAccessTokenStsEndpoint string `json:"oidcAccessTokenStsEndpoint,omitempty"`
15+
OidcAccessTokenIamSaEndpoint string `json:"oidcAccessTokenIamSaEndpoint,omitempty"`
16+
GcpServiceAccountEmail string `json:"gcpServiceAccountEmail,omitempty"`
17+
OidcWorkloadAccessTokenRequestStructure *OidcWorkloadAccessTokenRequest `json:"oidcWorkloadAccessTokenRequestStructure,omitempty"`
18+
OidcChartmuseumGcpConfigStructure *OidcChartmuseumGcpConfig `json:"oidcChartmuseumGcpConfigStructure,omitempty"`
19+
IdTokenExpiryTime int64 `json:"idTokenExpiryTime,omitempty"`
20+
}

harness/nextgen/model_gcp_secret_manager.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@ package nextgen
1111

1212
// This contains details of GCP Secret Manager
1313
type GcpSecretManager struct {
14-
ConnectorType string `json:"connectorType"`
15-
IsDefault bool `json:"isDefault,omitempty"`
1614
// Reference to the secret containing credentials of IAM service account for Google Secret Manager
17-
CredentialsRef string `json:"credentialsRef"`
15+
CredentialsRef string `json:"credentialsRef,omitempty"`
1816
// List of Delegate Selectors that belong to the same Delegate and are used to connect to the Secret Manager.
1917
DelegateSelectors []string `json:"delegateSelectors,omitempty"`
20-
Default_ bool `json:"default,omitempty"`
18+
// Should the secret manager execute operations on the delegate, or via Harness platform
19+
ExecuteOnDelegate bool `json:"executeOnDelegate"`
20+
// Boolean value to indicate that Credentials are taken from the Delegate.
21+
AssumeCredentialsOnDelegate bool `json:"assumeCredentialsOnDelegate"`
22+
Credential *GcpConnectorCredential `json:"credential,omitempty"`
23+
GcpOidcTokenExchangeDetailsForDelegate *GcpOidcTokenExchangeDetailsForDelegate `json:"gcpOidcTokenExchangeDetailsForDelegate,omitempty"`
24+
IgnoreTestConnection bool `json:"ignoreTestConnection,omitempty"`
25+
Default_ bool `json:"default"`
26+
ConnectorType string `json:"connectorType"`
2127
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Harness NextGen Software Delivery Platform API Reference
3+
*
4+
* This is the Open Api Spec 3 for the NextGen Manager. This is under active development. Beware of the breaking change with respect to the generated code stub
5+
*
6+
* API version: 3.0
7+
* Contact: contact@harness.io
8+
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
9+
*/
10+
package nextgen
11+
12+
type OidcAccessTokenOptions struct {
13+
UserProject string `json:"userProject,omitempty"`
14+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Harness NextGen Software Delivery Platform API Reference
3+
*
4+
* This is the Open Api Spec 3 for the NextGen Manager. This is under active development. Beware of the breaking change with respect to the generated code stub
5+
*
6+
* API version: 3.0
7+
* Contact: contact@harness.io
8+
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
9+
*/
10+
package nextgen
11+
12+
type OidcChartmuseumGcpConfig struct {
13+
Type_ string `json:"type,omitempty"`
14+
Audience string `json:"audience,omitempty"`
15+
SubjectTokenType string `json:"subject_token_type,omitempty"`
16+
TokenUrl string `json:"token_url,omitempty"`
17+
ServiceAccountImpersonationUrl string `json:"service_account_impersonation_url,omitempty"`
18+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Harness NextGen Software Delivery Platform API Reference
3+
*
4+
* This is the Open Api Spec 3 for the NextGen Manager. This is under active development. Beware of the breaking change with respect to the generated code stub
5+
*
6+
* API version: 3.0
7+
* Contact: contact@harness.io
8+
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
9+
*/
10+
package nextgen
11+
12+
type OidcWorkloadAccessTokenRequest struct {
13+
Audience string `json:"audience,omitempty"`
14+
GrantType string `json:"grant_type,omitempty"`
15+
RequestedTokenType string `json:"requested_token_type,omitempty"`
16+
Scope string `json:"scope,omitempty"`
17+
SubjectTokenType string `json:"subject_token_type,omitempty"`
18+
SubjectToken string `json:"subject_token,omitempty"`
19+
Options *OidcAccessTokenOptions `json:"options,omitempty"`
20+
}

0 commit comments

Comments
 (0)