From 6ca8b9e9c3edabba77e81b3e4605f1eee5e8239c Mon Sep 17 00:00:00 2001
From: Dirty Gooback <19241000+dirtygooback@users.noreply.github.com>
Date: Fri, 8 Dec 2023 08:14:27 -0500
Subject: [PATCH] implement actions OIDC client
---
.../Clients/IObservableActionsClient.cs | 5 +
.../Clients/IObservableActionsOidcClient.cs | 58 ++++++
.../Clients/ObservableActionsClient.cs | 7 +
.../Clients/ObservableActionsOidcClient.cs | 66 +++++++
.../Clients/ActionsOidcClientTests.cs | 165 ++++++++++++++++++
Octokit/Clients/ActionsClient.cs | 10 +-
Octokit/Clients/ActionsOidcClient.cs | 63 +++++++
Octokit/Clients/IActionsClient.cs | 6 +
Octokit/Clients/IActionsOidcClient.cs | 57 ++++++
Octokit/Helpers/ApiUrls.cs | 21 +++
Octokit/Models/Common/PackageVersionState.cs | 2 +-
.../OrganizationOidcSubjectClaimRequest.cs | 38 ++++
.../RepositoryOidcSubjectClaimRequest.cs | 46 +++++
.../Response/OrganizationOidcSubjectClaim.cs | 38 ++++
.../Response/RepositoryOidcSubjectClaim.cs | 46 +++++
15 files changed, 626 insertions(+), 2 deletions(-)
create mode 100644 Octokit.Reactive/Clients/IObservableActionsOidcClient.cs
create mode 100644 Octokit.Reactive/Clients/ObservableActionsOidcClient.cs
create mode 100644 Octokit.Tests/Clients/ActionsOidcClientTests.cs
create mode 100644 Octokit/Clients/ActionsOidcClient.cs
create mode 100644 Octokit/Clients/IActionsOidcClient.cs
create mode 100644 Octokit/Models/Request/OrganizationOidcSubjectClaimRequest.cs
create mode 100644 Octokit/Models/Request/RepositoryOidcSubjectClaimRequest.cs
create mode 100644 Octokit/Models/Response/OrganizationOidcSubjectClaim.cs
create mode 100644 Octokit/Models/Response/RepositoryOidcSubjectClaim.cs
diff --git a/Octokit.Reactive/Clients/IObservableActionsClient.cs b/Octokit.Reactive/Clients/IObservableActionsClient.cs
index 5397fd80e5..6651b1300a 100644
--- a/Octokit.Reactive/Clients/IObservableActionsClient.cs
+++ b/Octokit.Reactive/Clients/IObservableActionsClient.cs
@@ -18,6 +18,11 @@ public interface IObservableActionsClient
///
IObservableActionsCacheClient Cache { get; }
+ ///
+ /// Client for the OIDC API.
+ ///
+ IObservableActionsOidcClient Oidc { get; }
+
///
/// Client for the Permissions API.
///
diff --git a/Octokit.Reactive/Clients/IObservableActionsOidcClient.cs b/Octokit.Reactive/Clients/IObservableActionsOidcClient.cs
new file mode 100644
index 0000000000..9f161907c6
--- /dev/null
+++ b/Octokit.Reactive/Clients/IObservableActionsOidcClient.cs
@@ -0,0 +1,58 @@
+using System;
+using System.Reactive;
+using System.Threading.Tasks;
+
+namespace Octokit.Reactive
+{
+ ///
+ /// A client for GitHub's Actions OIDC API.
+ ///
+ ///
+ /// See the Actions OIDC API documentation for more information.
+ ///
+ public interface IObservableActionsOidcClient
+ {
+ ///
+ /// Get the customization template for an OIDC subject claim for an organization.
+ ///
+ ///
+ /// https://docs.github.com/en/rest/actions/oidc?apiVersion=2022-11-28#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization
+ ///
+ /// The organization name.
+ IObservable GetOrganizationOidcSubjectClaim(string organization);
+
+
+ ///
+ /// Set the customization template for an OIDC subject claim for an organization.
+ ///
+ ///
+ /// https://docs.github.com/en/rest/actions/oidc?apiVersion=2022-11-28#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization
+ ///
+ /// The organization name.
+ /// The OIDC subject claim to set for the organization.
+ IObservable SetOrganizationOidcSubjectClaim(string organization, OrganizationOidcSubjectClaimRequest oidcSubjectClaim);
+
+ ///
+ /// Get the customization template for an OIDC subject claim for a repository.
+ ///
+ ///
+ /// https://docs.github.com/en/rest/actions/oidc?apiVersion=2022-11-28#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository
+ ///
+ /// The account owner of the repository.
+ /// The name of the repository.
+ ///
+ IObservable GetRepositoryOidcSubjectClaim(string owner, string repository);
+
+ ///
+ ///
+ ///
+ ///
+ /// https://docs.github.com/en/rest/actions/oidc?apiVersion=2022-11-28#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository
+ ///
+ /// The account owner of the repository.
+ /// The name of the repository.
+ /// The OIDC subject claim to set for the repository.
+ ///
+ IObservable SetRepositoryOidcSubjectClaim(string owner, string repository, RepositoryOidcSubjectClaimRequest oidcSubjectClaim);
+ }
+}
diff --git a/Octokit.Reactive/Clients/ObservableActionsClient.cs b/Octokit.Reactive/Clients/ObservableActionsClient.cs
index 3b0e44620a..13f0a39040 100644
--- a/Octokit.Reactive/Clients/ObservableActionsClient.cs
+++ b/Octokit.Reactive/Clients/ObservableActionsClient.cs
@@ -18,6 +18,7 @@ public ObservableActionsClient(IGitHubClient client)
Artifacts = new ObservableActionsArtifactsClient(client);
Cache = new ObservableActionsCacheClient(client);
+ Oidc = new ObservableActionsOidcClient(client);
Permissions = new ObservableActionsPermissionsClient(client);
SelfHostedRunnerGroups = new ObservableActionsSelfHostedRunnerGroupsClient(client);
SelfHostedRunners = new ObservableActionsSelfHostedRunnersClient(client);
@@ -34,6 +35,12 @@ public ObservableActionsClient(IGitHubClient client)
///
public IObservableActionsCacheClient Cache { get; private set; }
+
+ ///
+ /// Client for the OIDC API.
+ ///
+ public IObservableActionsOidcClient Oidc { get; private set; }
+
///
/// Client for the Permissions API.
///
diff --git a/Octokit.Reactive/Clients/ObservableActionsOidcClient.cs b/Octokit.Reactive/Clients/ObservableActionsOidcClient.cs
new file mode 100644
index 0000000000..256d53622b
--- /dev/null
+++ b/Octokit.Reactive/Clients/ObservableActionsOidcClient.cs
@@ -0,0 +1,66 @@
+using System;
+using System.Reactive;
+using System.Reactive.Threading.Tasks;
+
+namespace Octokit.Reactive
+{
+
+ ///
+ /// A client for GitHub's Actions OIDC API.
+ ///
+ ///
+ /// See the Actions OIDC API documentation for more information.
+ ///
+ public class ObservableActionsOidcClient : IObservableActionsOidcClient
+ {
+ readonly IActionsOidcClient _client;
+
+
+ ///
+ /// Initializes a new GitHub Actions OIDC API client
+ ///
+ /// A GitHub client.
+ public ObservableActionsOidcClient(IGitHubClient client)
+ {
+ Ensure.ArgumentNotNull(client, nameof(client));
+
+ _client = client.Actions.Oidc;
+ }
+
+
+ ///
+ public IObservable GetOrganizationOidcSubjectClaim(string organization)
+ {
+ Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization));
+ return _client.GetOrganizationOidcSubjectClaim(organization).ToObservable();
+ }
+
+ ///
+ public IObservable SetOrganizationOidcSubjectClaim(string organization, OrganizationOidcSubjectClaimRequest oidcSubjectClaim)
+ {
+ Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization));
+ Ensure.ArgumentNotNull(oidcSubjectClaim, nameof(oidcSubjectClaim));
+
+ return _client.SetOrganizationOidcSubjectClaim(organization, oidcSubjectClaim).ToObservable();
+ }
+
+ ///
+ public IObservable GetRepositoryOidcSubjectClaim(string owner, string repository)
+ {
+ Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
+ Ensure.ArgumentNotNullOrEmptyString(repository, nameof(repository));
+
+ return _client.GetRepositoryOidcSubjectClaim(owner, repository).ToObservable();
+ }
+
+ ///
+ public IObservable SetRepositoryOidcSubjectClaim(string owner, string repository, RepositoryOidcSubjectClaimRequest oidcSubjectClaim)
+ {
+ Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
+ Ensure.ArgumentNotNullOrEmptyString(repository, nameof(repository));
+ Ensure.ArgumentNotNull(oidcSubjectClaim, nameof(oidcSubjectClaim));
+
+ return _client.SetRepositoryOidcSubjectClaim(owner, repository, oidcSubjectClaim).ToObservable();
+ }
+ }
+}
diff --git a/Octokit.Tests/Clients/ActionsOidcClientTests.cs b/Octokit.Tests/Clients/ActionsOidcClientTests.cs
new file mode 100644
index 0000000000..1d5979776b
--- /dev/null
+++ b/Octokit.Tests/Clients/ActionsOidcClientTests.cs
@@ -0,0 +1,165 @@
+using NSubstitute;
+using Octokit.Clients;
+using System;
+using System.Threading.Tasks;
+using Xunit;
+
+
+namespace Octokit.Tests.Clients
+{
+ public class ActionsOidcClientTests
+ {
+ public class TheCtor
+ {
+ [Fact]
+ public void EnsuresNonNullArguments()
+ {
+ Assert.Throws(() => new ActionsOidcClient(null));
+ }
+ }
+
+ public class GetOrganizationOidcSubjectClaim_Method
+ {
+ [Fact]
+ public async Task RequestsCorrectUrl()
+ {
+ var connection = Substitute.For();
+ var client = new ActionsOidcClient(connection);
+
+ await client.GetOrganizationOidcSubjectClaim("fake");
+
+ connection.Received().Get(
+ Arg.Is(u => u.ToString() == "orgs/fake/actions/oidc/customization/sub"));
+ }
+
+ [Fact]
+ public async Task EnsuresNonNullArguments()
+ {
+ var connection = Substitute.For();
+ var client = new ActionsOidcClient(connection);
+
+ await Assert.ThrowsAsync(() => client.GetOrganizationOidcSubjectClaim(null));
+ }
+
+ [Fact]
+ public async Task EnsuresNonEmptyArguments()
+ {
+ var connection = Substitute.For();
+ var client = new ActionsOidcClient(connection);
+
+ await Assert.ThrowsAsync(() => client.GetOrganizationOidcSubjectClaim(""));
+ }
+ }
+
+ public class SetOrganizationOidcSubjectClaim_Method
+ {
+ [Fact]
+ public async Task RequestsCorrectUrl()
+ {
+ var connection = Substitute.For();
+ var client = new ActionsOidcClient(connection);
+ var newClaims = new OrganizationOidcSubjectClaimRequest(new System.Collections.Generic.List { "fake" });
+
+ await client.SetOrganizationOidcSubjectClaim("fake", newClaims);
+
+ connection.Received().Put(
+ Arg.Is(u => u.ToString() == "orgs/fake/actions/oidc/customization/sub"), newClaims);
+ }
+
+ [Fact]
+ public async Task EnsuresNonNullArguments()
+ {
+ var connection = Substitute.For();
+ var client = new ActionsOidcClient(connection);
+ var newClaims = new OrganizationOidcSubjectClaimRequest(new System.Collections.Generic.List { "fake" });
+
+ await Assert.ThrowsAsync(() => client.SetOrganizationOidcSubjectClaim(null, newClaims));
+ await Assert.ThrowsAsync(() => client.SetOrganizationOidcSubjectClaim("fake", null));
+ }
+
+ [Fact]
+ public async Task EnsuresNonEmptyArguments()
+ {
+ var connection = Substitute.For();
+ var client = new ActionsOidcClient(connection);
+ var newClaims = new OrganizationOidcSubjectClaimRequest(new System.Collections.Generic.List { "fake" });
+
+ await Assert.ThrowsAsync(() => client.SetOrganizationOidcSubjectClaim("", newClaims));
+ }
+ }
+
+ public class GetRepositoryOidcSubjectClaim_Method
+ {
+ [Fact]
+ public async Task RequestsCorrectUrl()
+ {
+ var connection = Substitute.For();
+ var client = new ActionsOidcClient(connection);
+
+ await client.GetRepositoryOidcSubjectClaim("fake", "abc");
+
+ connection.Received().Get(
+ Arg.Is(u => u.ToString() == "repos/fake/abc/actions/oidc/customization/sub"));
+ }
+
+ [Fact]
+ public async Task EnsuresNonNullArguments()
+ {
+ var connection = Substitute.For();
+ var client = new ActionsOidcClient(connection);
+
+ await Assert.ThrowsAsync(() => client.GetRepositoryOidcSubjectClaim(null, "repo"));
+ await Assert.ThrowsAsync(() => client.GetRepositoryOidcSubjectClaim("owner", null));
+ }
+
+ [Fact]
+ public async Task EnsuresNonEmptyArguments()
+ {
+ var connection = Substitute.For();
+ var client = new ActionsOidcClient(connection);
+
+ await Assert.ThrowsAsync(() => client.GetRepositoryOidcSubjectClaim("", "repo"));
+ await Assert.ThrowsAsync(() => client.GetRepositoryOidcSubjectClaim("owner", ""));
+ }
+ }
+
+ public class SetRepositoryOidcSubjectClaim_Method
+ {
+ [Fact]
+ public async Task RequestsCorrectUrl()
+ {
+ var connection = Substitute.For();
+ var client = new ActionsOidcClient(connection);
+ var newClaims = new RepositoryOidcSubjectClaimRequest(false, new System.Collections.Generic.List { "fake" });
+
+ await client.SetRepositoryOidcSubjectClaim("fake", "abc", newClaims);
+
+ connection.Received().Put(
+ Arg.Is(u => u.ToString() == "repos/fake/abc/actions/oidc/customization/sub"), newClaims);
+ }
+
+ [Fact]
+ public async Task EnsuresNonNullArguments()
+ {
+ var connection = Substitute.For();
+ var client = new ActionsOidcClient(connection);
+ var newClaims = new RepositoryOidcSubjectClaimRequest(false, new System.Collections.Generic.List { "fake" });
+
+ await Assert.ThrowsAsync(() => client.SetRepositoryOidcSubjectClaim(null, "repo", newClaims));
+ await Assert.ThrowsAsync(() => client.SetRepositoryOidcSubjectClaim("owner", null, newClaims));
+ await Assert.ThrowsAsync(() => client.SetRepositoryOidcSubjectClaim("owner", "repo", null));
+ }
+
+ [Fact]
+ public async Task EnsuresNonEmptyArguments()
+ {
+ var connection = Substitute.For();
+ var client = new ActionsOidcClient(connection);
+ var newClaims = new RepositoryOidcSubjectClaimRequest(false, new System.Collections.Generic.List { "fake" });
+
+ await Assert.ThrowsAsync(() => client.SetRepositoryOidcSubjectClaim("", "repo", newClaims));
+ await Assert.ThrowsAsync(() => client.SetRepositoryOidcSubjectClaim("owner", "", newClaims));
+ }
+ }
+ }
+}
diff --git a/Octokit/Clients/ActionsClient.cs b/Octokit/Clients/ActionsClient.cs
index 9034b14936..a9a37a5aff 100644
--- a/Octokit/Clients/ActionsClient.cs
+++ b/Octokit/Clients/ActionsClient.cs
@@ -1,4 +1,6 @@
-namespace Octokit
+using Octokit.Clients;
+
+namespace Octokit
{
///
/// A client for GitHub's Actions API.
@@ -17,6 +19,7 @@ public ActionsClient(IApiConnection apiConnection)
{
Artifacts = new ActionsArtifactsClient(apiConnection);
Cache = new ActionsCacheClient(apiConnection);
+ Oidc = new ActionsOidcClient(apiConnection);
Permissions = new ActionsPermissionsClient(apiConnection);
SelfHostedRunnerGroups = new ActionsSelfHostedRunnerGroupsClient(apiConnection);
SelfHostedRunners = new ActionsSelfHostedRunnersClient(apiConnection);
@@ -33,6 +36,11 @@ public ActionsClient(IApiConnection apiConnection)
///
public IActionsCacheClient Cache { get; private set; }
+ ///
+ /// Client for the OIDC API.
+ ///
+ public IActionsOidcClient Oidc { get; private set; }
+
///
/// Client for the Permissions API.
///
diff --git a/Octokit/Clients/ActionsOidcClient.cs b/Octokit/Clients/ActionsOidcClient.cs
new file mode 100644
index 0000000000..b3dd60d536
--- /dev/null
+++ b/Octokit/Clients/ActionsOidcClient.cs
@@ -0,0 +1,63 @@
+using System.Threading.Tasks;
+
+namespace Octokit.Clients
+{
+
+ ///
+ /// A client for GitHub's Actions OIDC API.
+ ///
+ ///
+ /// See the Actions OIDC API documentation for more information.
+ ///
+ public class ActionsOidcClient : ApiClient, IActionsOidcClient
+ {
+ ///
+ /// Initializes a new GitHub Actions OIDC API client
+ ///
+ /// An API connection
+ public ActionsOidcClient(IApiConnection apiConnection) : base(apiConnection)
+ {
+ }
+
+
+ ///
+ [ManualRoute("GET", "/orgs/{organization}/actions/oidc/customization/sub")]
+ public Task GetOrganizationOidcSubjectClaim(string organization)
+ {
+ Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization));
+
+ return ApiConnection.Get(ApiUrls.ActionsOrganizationOidcSubjectClaim(organization));
+ }
+
+ ///
+ [ManualRoute("PUT", "/orgs/{organization}/actions/oidc/customization/sub")]
+ public Task SetOrganizationOidcSubjectClaim(string organization, OrganizationOidcSubjectClaimRequest oidcSubjectClaim)
+ {
+ Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization));
+ Ensure.ArgumentNotNull(oidcSubjectClaim, nameof(oidcSubjectClaim));
+
+ return ApiConnection.Put(ApiUrls.ActionsOrganizationOidcSubjectClaim(organization), oidcSubjectClaim);
+ }
+
+ ///
+ [ManualRoute("GET", "/repos/{owner}/{repository}/actions/oidc/customization/sub")]
+ public Task GetRepositoryOidcSubjectClaim(string owner, string repository)
+ {
+ Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
+ Ensure.ArgumentNotNullOrEmptyString(repository, nameof(repository));
+
+ return ApiConnection.Get(ApiUrls.ActionsRepositoryOidcSubjectClaim(owner, repository));
+ }
+
+ ///
+ [ManualRoute("PUT", "/repos/{owner}/{repository}/actions/oidc/customization/sub")]
+ public Task SetRepositoryOidcSubjectClaim(string owner, string repository, RepositoryOidcSubjectClaimRequest oidcSubjectClaim)
+ {
+ Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
+ Ensure.ArgumentNotNullOrEmptyString(repository, nameof(repository));
+ Ensure.ArgumentNotNull(oidcSubjectClaim, nameof(oidcSubjectClaim));
+
+ return ApiConnection.Put(ApiUrls.ActionsRepositoryOidcSubjectClaim(owner, repository), oidcSubjectClaim);
+ }
+ }
+}
diff --git a/Octokit/Clients/IActionsClient.cs b/Octokit/Clients/IActionsClient.cs
index 027cffc00d..b6fb6b43e6 100644
--- a/Octokit/Clients/IActionsClient.cs
+++ b/Octokit/Clients/IActionsClient.cs
@@ -18,6 +18,12 @@ public interface IActionsClient
///
IActionsCacheClient Cache { get; }
+
+ ///
+ /// Client for the OIDC API.
+ ///
+ IActionsOidcClient Oidc { get; }
+
///
/// Client for the Permissions API.
///
diff --git a/Octokit/Clients/IActionsOidcClient.cs b/Octokit/Clients/IActionsOidcClient.cs
new file mode 100644
index 0000000000..46e67b0131
--- /dev/null
+++ b/Octokit/Clients/IActionsOidcClient.cs
@@ -0,0 +1,57 @@
+using System.Threading.Tasks;
+
+
+namespace Octokit
+{
+ ///
+ /// A client for GitHub's Actions OIDC API.
+ ///
+ ///
+ /// See the Actions OIDC API documentation for more information.
+ ///
+ public interface IActionsOidcClient
+ {
+ ///
+ /// Get the customization template for an OIDC subject claim for an organization.
+ ///
+ ///
+ /// https://docs.github.com/en/rest/actions/oidc?apiVersion=2022-11-28#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization
+ ///
+ /// The organization name.
+ Task GetOrganizationOidcSubjectClaim(string organization);
+
+
+ ///
+ /// Set the customization template for an OIDC subject claim for an organization.
+ ///
+ ///
+ /// https://docs.github.com/en/rest/actions/oidc?apiVersion=2022-11-28#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization
+ ///
+ /// The organization name.
+ /// The OIDC subject claim to set for the organization.
+ Task SetOrganizationOidcSubjectClaim(string organization, OrganizationOidcSubjectClaimRequest oidcSubjectClaim);
+
+ ///
+ /// Get the customization template for an OIDC subject claim for a repository.
+ ///
+ ///
+ /// https://docs.github.com/en/rest/actions/oidc?apiVersion=2022-11-28#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository
+ ///
+ /// The account owner of the repository.
+ /// The name of the repository.
+ ///
+ Task GetRepositoryOidcSubjectClaim(string owner, string repository);
+
+ ///
+ ///
+ ///
+ ///
+ /// https://docs.github.com/en/rest/actions/oidc?apiVersion=2022-11-28#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository
+ ///
+ /// The account owner of the repository.
+ /// The name of the repository.
+ /// The OIDC subject claim to set for the repository.
+ ///
+ Task SetRepositoryOidcSubjectClaim(string owner, string repository, RepositoryOidcSubjectClaimRequest oidcSubjectClaim);
+ }
+}
diff --git a/Octokit/Helpers/ApiUrls.cs b/Octokit/Helpers/ApiUrls.cs
index 41cb5ca958..d725afc841 100644
--- a/Octokit/Helpers/ApiUrls.cs
+++ b/Octokit/Helpers/ApiUrls.cs
@@ -5566,5 +5566,26 @@ public static Uri RepositoryBranchRename(string owner, string repository, string
{
return "repos/{0}/{1}/branches/{2}/rename".FormatUri(owner, repository, branch);
}
+
+ ///
+ /// Returns the to get or set an organization OIDC subject claim.
+ ///
+ /// The organization name
+ ///
+ public static Uri ActionsOrganizationOidcSubjectClaim(string organization)
+ {
+ return "orgs/{0}/actions/oidc/customization/sub".FormatUri(organization);
+ }
+
+ ///
+ /// Returns the to get or set a repository OIDC subject claim.
+ ///
+ /// The account owner of the repository
+ /// The name of the repository
+ ///
+ public static Uri ActionsRepositoryOidcSubjectClaim(string owner, string repository)
+ {
+ return "repos/{0}/{1}/actions/oidc/customization/sub".FormatUri(owner, repository);
+ }
}
}
diff --git a/Octokit/Models/Common/PackageVersionState.cs b/Octokit/Models/Common/PackageVersionState.cs
index fc90f32c30..80a79a9b27 100644
--- a/Octokit/Models/Common/PackageVersionState.cs
+++ b/Octokit/Models/Common/PackageVersionState.cs
@@ -11,7 +11,7 @@ public enum PackageVersionState
Active,
///
- /// Package version whic is deleted
+ /// Package version which is deleted
///
[Parameter(Value = "deleted")]
Deleted
diff --git a/Octokit/Models/Request/OrganizationOidcSubjectClaimRequest.cs b/Octokit/Models/Request/OrganizationOidcSubjectClaimRequest.cs
new file mode 100644
index 0000000000..0d3070d9b8
--- /dev/null
+++ b/Octokit/Models/Request/OrganizationOidcSubjectClaimRequest.cs
@@ -0,0 +1,38 @@
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Globalization;
+
+namespace Octokit
+{
+ [DebuggerDisplay("{DebuggerDisplay,nq}")]
+ public class OrganizationOidcSubjectClaimRequest
+ {
+ public OrganizationOidcSubjectClaimRequest()
+ { }
+
+ ///
+ /// Initializes a new instance of the class
+ ///
+ /// Array of unique strings. Each claim key can only contain alphanumeric characters and underscores.
+ public OrganizationOidcSubjectClaimRequest(List includeClaimKeys)
+ {
+ this.IncludeClaimKeys = includeClaimKeys;
+ }
+
+
+ ///
+ /// Array of unique strings. Each claim key can only contain alphanumeric characters and underscores.
+ ///
+ public List IncludeClaimKeys { get; set; }
+
+
+ internal string DebuggerDisplay
+ {
+ get
+ {
+ return string.Format(CultureInfo.InvariantCulture,
+ "OrganizationOidcSubjectClaimRequest: IncludeClaimKeys {0}", IncludeClaimKeys);
+ }
+ }
+ }
+}
diff --git a/Octokit/Models/Request/RepositoryOidcSubjectClaimRequest.cs b/Octokit/Models/Request/RepositoryOidcSubjectClaimRequest.cs
new file mode 100644
index 0000000000..2bd7644ba0
--- /dev/null
+++ b/Octokit/Models/Request/RepositoryOidcSubjectClaimRequest.cs
@@ -0,0 +1,46 @@
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Globalization;
+
+
+namespace Octokit
+{
+ [DebuggerDisplay("{DebuggerDisplay,nq}")]
+ public class RepositoryOidcSubjectClaimRequest
+ {
+ public RepositoryOidcSubjectClaimRequest()
+ { }
+
+ ///
+ /// Initializes a new instance of the class
+ ///
+ /// Whether to use the default template or not. If true, the IncludeClaimKeys field is ignored.
+ /// Array of unique strings. Each claim key can only contain alphanumeric characters and underscores.
+ public RepositoryOidcSubjectClaimRequest(bool useDefault, List includeClaimKeys)
+ {
+ this.UseDefault = useDefault;
+ this.IncludeClaimKeys = includeClaimKeys;
+ }
+
+
+ ///
+ /// Whether to use the default template or not. If true, the IncludeClaimKeys field is ignored.
+ ///
+ public bool UseDefault { get; set; }
+
+ ///
+ /// Array of unique strings. Each claim key can only contain alphanumeric characters and underscores.
+ ///
+ public List IncludeClaimKeys { get; set; }
+
+
+ internal string DebuggerDisplay
+ {
+ get
+ {
+ return string.Format(CultureInfo.InvariantCulture,
+ "RepositoryOidcSubjectClaimRequest: UseDefault: {0} IncludeClaimKeys {1}", this.UseDefault, this.IncludeClaimKeys);
+ }
+ }
+ }
+}
diff --git a/Octokit/Models/Response/OrganizationOidcSubjectClaim.cs b/Octokit/Models/Response/OrganizationOidcSubjectClaim.cs
new file mode 100644
index 0000000000..b9bf8d91c4
--- /dev/null
+++ b/Octokit/Models/Response/OrganizationOidcSubjectClaim.cs
@@ -0,0 +1,38 @@
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Globalization;
+
+namespace Octokit
+{
+ [DebuggerDisplay("{DebuggerDisplay,nq}")]
+ public class OrganizationOidcSubjectClaim
+ {
+ public OrganizationOidcSubjectClaim()
+ { }
+
+ ///
+ /// Initializes a new instance of the class
+ ///
+ /// Array of unique strings. Each claim key can only contain alphanumeric characters and underscores.
+ public OrganizationOidcSubjectClaim(List includeClaimKeys)
+ {
+ this.IncludeClaimKeys = includeClaimKeys;
+ }
+
+
+ ///
+ /// Array of unique strings. Each claim key can only contain alphanumeric characters and underscores.
+ ///
+ public IReadOnlyList IncludeClaimKeys { get; protected set; }
+
+
+ internal string DebuggerDisplay
+ {
+ get
+ {
+ return string.Format(CultureInfo.InvariantCulture,
+ "OrganizationOidcSubjectClaimResponse: IncludeClaimKeys {0}", IncludeClaimKeys);
+ }
+ }
+ }
+}
diff --git a/Octokit/Models/Response/RepositoryOidcSubjectClaim.cs b/Octokit/Models/Response/RepositoryOidcSubjectClaim.cs
new file mode 100644
index 0000000000..81dfa14f92
--- /dev/null
+++ b/Octokit/Models/Response/RepositoryOidcSubjectClaim.cs
@@ -0,0 +1,46 @@
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Globalization;
+
+
+namespace Octokit
+{
+ [DebuggerDisplay("{DebuggerDisplay,nq}")]
+ public class RepositoryOidcSubjectClaim
+ {
+ public RepositoryOidcSubjectClaim()
+ { }
+
+ ///
+ /// Initializes a new instance of the class
+ ///
+ /// Whether to use the default template or not. If true, the IncludeClaimKeys field is ignored.
+ /// Array of unique strings. Each claim key can only contain alphanumeric characters and underscores.
+ public RepositoryOidcSubjectClaim(bool useDefault, List includeClaimKeys)
+ {
+ this.UseDefault = useDefault;
+ this.IncludeClaimKeys = includeClaimKeys;
+ }
+
+
+ ///
+ /// Whether to use the default template or not. If true, the IncludeClaimKeys field is ignored.
+ ///
+ public bool UseDefault { get; protected set; }
+
+ ///
+ /// Array of unique strings. Each claim key can only contain alphanumeric characters and underscores.
+ ///
+ public IReadOnlyList IncludeClaimKeys { get; protected set; }
+
+
+ internal string DebuggerDisplay
+ {
+ get
+ {
+ return string.Format(CultureInfo.InvariantCulture,
+ "RepositoryOidcSubjectClaim: UseDefault: {0} IncludeClaimKeys {1}", this.UseDefault, this.IncludeClaimKeys);
+ }
+ }
+ }
+}