mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-05 23:06:10 +00:00
* Add support for /mets/public_keys/<keyType> * "files.insertFinalNewline": false * revert and make setttings.json change csharp only * formatting * remove final new line --------- Co-authored-by: Nick Floyd <139819+nickfloyd@users.noreply.github.com>
35 lines
1.2 KiB
C#
35 lines
1.2 KiB
C#
using System;
|
|
using System.Reactive.Linq;
|
|
using System.Reactive.Threading.Tasks;
|
|
|
|
namespace Octokit.Reactive
|
|
{
|
|
/// <summary>
|
|
/// A client for GitHub's public keys API.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// See the <a href="https://docs.github.com/code-security/secret-scanning/secret-scanning-partner-program#implement-signature-verification-in-your-secret-alert-service">Secret scanning documentation</a> for more details.
|
|
/// </remarks>
|
|
public class ObservablePublicKeysClient : IObservablePublicKeysClient
|
|
{
|
|
private readonly IPublicKeysClient _client;
|
|
|
|
public ObservablePublicKeysClient(IGitHubClient client)
|
|
{
|
|
Ensure.ArgumentNotNull(client, nameof(client));
|
|
|
|
_client = client.Meta.PublicKeys;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Retrieves public keys for validating request signatures.
|
|
/// </summary>
|
|
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
|
/// <returns>An <see cref="MetaPublicKeys"/> containing public keys for validating request signatures.</returns>
|
|
public IObservable<MetaPublicKeys> Get(PublicKeyType keysType)
|
|
{
|
|
return _client.Get(keysType).ToObservable();
|
|
}
|
|
}
|
|
}
|