Skip to content

Commit 816d5fa

Browse files
lovish1999Harness
authored andcommitted
[feat]: [CDS-109142]: Add support for azure OIDC authentication type (#687)
* 422c57 [feat]: [CDS-109142]: Add support for azure oidc authentication type
1 parent 16a8c7e commit 816d5fa

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

harness/nextgen/enum_azure_credential_types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ type AzureCredentialType string
55
var AzureCredentialTypes = struct {
66
InheritFromDelegate AzureCredentialType
77
ManualConfig AzureCredentialType
8+
OidcAuthentication AzureCredentialType
89
}{
910
InheritFromDelegate: "InheritFromDelegate",
1011
ManualConfig: "ManualConfig",
12+
OidcAuthentication: "OidcAuthentication",
1113
}
1214

1315
var AzureCredentialTypeValues = []string{
1416
AzureCredentialTypes.InheritFromDelegate.String(),
1517
AzureCredentialTypes.ManualConfig.String(),
18+
AzureCredentialTypes.OidcAuthentication.String(),
1619
}
1720

1821
func (e AzureCredentialType) String() string {

harness/nextgen/model_azure_credential.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ type AzureCredential struct {
1616
Type_ AzureCredentialType `json:"type"`
1717
AzureManualDetails *AzureManualDetails `json:"-"`
1818
AzureInheritFromDelegateDetails *AzureInheritFromDelegateDetails `json:"-"`
19+
AzureOidcSpec *AzureOidcSpec `json:"-"`
1920
Spec json.RawMessage `json:"spec,omitempty"`
2021
}

harness/nextgen/model_azure_credential_serializer.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ func (a *AzureCredential) UnmarshalJSON(data []byte) error {
2424
err = json.Unmarshal(aux.Spec, &a.AzureInheritFromDelegateDetails)
2525
case AzureCredentialTypes.ManualConfig:
2626
err = json.Unmarshal(aux.Spec, &a.AzureManualDetails)
27+
case AzureCredentialTypes.OidcAuthentication:
28+
err = json.Unmarshal(aux.Spec, &a.AzureOidcSpec)
2729
default:
2830
panic(fmt.Sprintf("unknown azure credential type %s", a.Type_))
2931
}
@@ -42,6 +44,8 @@ func (a *AzureCredential) MarshalJSON() ([]byte, error) {
4244
spec, err = json.Marshal(a.AzureInheritFromDelegateDetails)
4345
case AzureCredentialTypes.ManualConfig:
4446
spec, err = json.Marshal(a.AzureManualDetails)
47+
case AzureCredentialTypes.OidcAuthentication:
48+
spec, err = json.Marshal(a.AzureOidcSpec)
4549
default:
4650
panic(fmt.Sprintf("unknown azure credential type %s", a.Type_))
4751
}
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 # Authentication <!-- ReDoc-Inject: <security-definitions> -->
5+
*
6+
* API version: 3.0
7+
* Contact: [email protected]
8+
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
9+
*/
10+
package nextgen
11+
12+
// This contains Azure OIDC connector details
13+
type AzureOidcSpec struct {
14+
// Application ID of the Azure App.
15+
ApplicationId string `json:"applicationId"`
16+
// The Azure Active Directory (AAD) directory ID where you created your application.
17+
TenantId string `json:"tenantId"`
18+
// Audience.
19+
Audience string `json:"audience"`
20+
}

0 commit comments

Comments
 (0)