Skip to content

Commit

Permalink
aws oidc account
Browse files Browse the repository at this point in the history
  • Loading branch information
veochen-octopus committed Sep 20, 2023
1 parent dd9550f commit 9a4aef1
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,13 @@ Octopus.Client.Editors
{
.ctor(Octopus.Client.Repositories.IAccountRepository)
}
class AmazonWebServicesOidcAccountEditor
Octopus.Client.Editors.IResourceEditor<AmazonWebServicesOidcAccountResource, AmazonWebServicesOidcAccountEditor>
Octopus.Client.Editors.IResourceBuilder
Octopus.Client.Editors.AccountEditor<AmazonWebServicesOidcAccountResource, AmazonWebServicesOidcAccountEditor>
{
.ctor(Octopus.Client.Repositories.IAccountRepository)
}
class AzureServicePrincipalAccountEditor
Octopus.Client.Editors.IResourceEditor<AzureServicePrincipalAccountResource, AzureServicePrincipalAccountEditor>
Octopus.Client.Editors.IResourceBuilder
Expand Down Expand Up @@ -1051,6 +1058,13 @@ Octopus.Client.Editors.Async
{
.ctor(Octopus.Client.Repositories.Async.IAccountRepository)
}
class AmazonWebServicesOidcAccountEditor
Octopus.Client.Editors.Async.IResourceEditor<AmazonWebServicesOidcAccountResource, AmazonWebServicesOidcAccountEditor>
Octopus.Client.Editors.Async.IResourceBuilder
Octopus.Client.Editors.Async.AccountEditor<AmazonWebServicesOidcAccountResource, AmazonWebServicesOidcAccountEditor>
{
.ctor(Octopus.Client.Repositories.Async.IAccountRepository)
}
class AzureServicePrincipalAccountEditor
Octopus.Client.Editors.Async.IResourceEditor<AzureServicePrincipalAccountResource, AzureServicePrincipalAccountEditor>
Octopus.Client.Editors.Async.IResourceBuilder
Expand Down Expand Up @@ -5888,8 +5902,9 @@ Octopus.Client.Model.Accounts
AzureServicePrincipal = 4
AmazonWebServicesAccount = 5
AmazonWebServicesRoleAccount = 6
Token = 7
GoogleCloudAccount = 8
AmazonWebServicesOidcAccount = 7
Token = 8
GoogleCloudAccount = 9
}
class AmazonWebServicesAccountResource
Octopus.Client.Extensibility.IResource
Expand All @@ -5904,6 +5919,20 @@ Octopus.Client.Model.Accounts
Octopus.Client.Model.Accounts.AccountType AccountType { get; }
Octopus.Client.Model.SensitiveValue SecretKey { get; set; }
}
class AmazonWebServicesOidcAccountResource
Octopus.Client.Extensibility.IResource
Octopus.Client.Model.IAuditedResource
Octopus.Client.Extensibility.INamedResource
Octopus.Client.Extensibility.IHaveSpaceResource
Octopus.Client.Model.IHaveSlugResource
Octopus.Client.Model.Accounts.AccountResource
{
.ctor()
Octopus.Client.Model.Accounts.AccountType AccountType { get; }
String Audience { get; set; }
String RoleArn { get; set; }
String SessionDuration { get; set; }
}
class AzureServicePrincipalAccountResource
Octopus.Client.Extensibility.IResource
Octopus.Client.Model.IAuditedResource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,13 @@ Octopus.Client.Editors
{
.ctor(Octopus.Client.Repositories.IAccountRepository)
}
class AmazonWebServicesOidcAccountEditor
Octopus.Client.Editors.IResourceEditor<AmazonWebServicesOidcAccountResource, AmazonWebServicesOidcAccountEditor>
Octopus.Client.Editors.IResourceBuilder
Octopus.Client.Editors.AccountEditor<AmazonWebServicesOidcAccountResource, AmazonWebServicesOidcAccountEditor>
{
.ctor(Octopus.Client.Repositories.IAccountRepository)
}
class AzureServicePrincipalAccountEditor
Octopus.Client.Editors.IResourceEditor<AzureServicePrincipalAccountResource, AzureServicePrincipalAccountEditor>
Octopus.Client.Editors.IResourceBuilder
Expand Down Expand Up @@ -1052,6 +1059,13 @@ Octopus.Client.Editors.Async
{
.ctor(Octopus.Client.Repositories.Async.IAccountRepository)
}
class AmazonWebServicesOidcAccountEditor
Octopus.Client.Editors.Async.IResourceEditor<AmazonWebServicesOidcAccountResource, AmazonWebServicesOidcAccountEditor>
Octopus.Client.Editors.Async.IResourceBuilder
Octopus.Client.Editors.Async.AccountEditor<AmazonWebServicesOidcAccountResource, AmazonWebServicesOidcAccountEditor>
{
.ctor(Octopus.Client.Repositories.Async.IAccountRepository)
}
class AzureServicePrincipalAccountEditor
Octopus.Client.Editors.Async.IResourceEditor<AzureServicePrincipalAccountResource, AzureServicePrincipalAccountEditor>
Octopus.Client.Editors.Async.IResourceBuilder
Expand Down Expand Up @@ -5911,8 +5925,9 @@ Octopus.Client.Model.Accounts
AzureServicePrincipal = 4
AmazonWebServicesAccount = 5
AmazonWebServicesRoleAccount = 6
Token = 7
GoogleCloudAccount = 8
AmazonWebServicesOidcAccount = 7
Token = 8
GoogleCloudAccount = 9
}
class AmazonWebServicesAccountResource
Octopus.Client.Extensibility.IResource
Expand All @@ -5927,6 +5942,20 @@ Octopus.Client.Model.Accounts
Octopus.Client.Model.Accounts.AccountType AccountType { get; }
Octopus.Client.Model.SensitiveValue SecretKey { get; set; }
}
class AmazonWebServicesOidcAccountResource
Octopus.Client.Extensibility.IResource
Octopus.Client.Model.IAuditedResource
Octopus.Client.Extensibility.INamedResource
Octopus.Client.Extensibility.IHaveSpaceResource
Octopus.Client.Model.IHaveSlugResource
Octopus.Client.Model.Accounts.AccountResource
{
.ctor()
Octopus.Client.Model.Accounts.AccountType AccountType { get; }
String Audience { get; set; }
String RoleArn { get; set; }
String SessionDuration { get; set; }
}
class AzureServicePrincipalAccountResource
Octopus.Client.Extensibility.IResource
Octopus.Client.Model.IAuditedResource
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Octopus.Client.Model.Accounts;
using Octopus.Client.Repositories;

namespace Octopus.Client.Editors
{
public class AmazonWebServicesOidcAccountEditor : AccountEditor<AmazonWebServicesOidcAccountResource, AmazonWebServicesOidcAccountEditor>
{
public AmazonWebServicesOidcAccountEditor(IAccountRepository repository) : base(repository)
{
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Octopus.Client.Model.Accounts;
using Octopus.Client.Repositories.Async;

namespace Octopus.Client.Editors.Async
{
public class AmazonWebServicesOidcAccountEditor : AccountEditor<AmazonWebServicesOidcAccountResource, AmazonWebServicesOidcAccountEditor>
{
public AmazonWebServicesOidcAccountEditor(IAccountRepository repository) : base(repository)
{
}
}
}
2 changes: 2 additions & 0 deletions source/Octopus.Server.Client/Extensions/TypeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public static AccountType DetermineAccountType(this Type type)
accountType = AccountType.AzureSubscription;
else if (type == typeof(AmazonWebServicesAccountResource))
accountType = AccountType.AmazonWebServicesAccount;
else if (type == typeof(AmazonWebServicesOidcAccountResource))
accountType = AccountType.AmazonWebServicesOidcAccount;
else if (type == typeof(TokenAccountResource))
accountType = AccountType.Token;
else if (type == typeof(GoogleCloudAccountResource))
Expand Down
1 change: 1 addition & 0 deletions source/Octopus.Server.Client/Model/Accounts/AccountType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public enum AccountType
AzureServicePrincipal,
AmazonWebServicesAccount,
AmazonWebServicesRoleAccount,
AmazonWebServicesOidcAccount,
Token,
GoogleCloudAccount,
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System.ComponentModel.DataAnnotations;
using Octopus.Client.Extensibility.Attributes;

namespace Octopus.Client.Model.Accounts
{
public class AmazonWebServicesOidcAccountResource : AccountResource
{
public override AccountType AccountType => AccountType.AmazonWebServicesOidcAccount;

[Trim]
[Writeable]
public string RoleArn { get; set; }

[Trim]
[Writeable]
[Required]
public string SessionDuration { get; set; }

[Trim]
[Writeable]
[Required]
public string Audience { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class AccountConverter : InheritedClassConverter<AccountResource, Account
{AccountType.AzureServicePrincipal, typeof(AzureServicePrincipalAccountResource)},
{AccountType.SshKeyPair, typeof(SshKeyPairAccountResource)},
{AccountType.AmazonWebServicesAccount, typeof(AmazonWebServicesAccountResource)},
{AccountType.AmazonWebServicesOidcAccount, typeof(AmazonWebServicesOidcAccountResource)},
{AccountType.Token, typeof(TokenAccountResource)},
{AccountType.GoogleCloudAccount, typeof(GoogleCloudAccountResource)}
};
Expand Down

0 comments on commit 9a4aef1

Please sign in to comment.