BurakKontas.OAuth2.Google.Polly 1.0.0

dotnet add package BurakKontas.OAuth2.Google.Polly --version 1.0.0                
NuGet\Install-Package BurakKontas.OAuth2.Google.Polly -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BurakKontas.OAuth2.Google.Polly" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BurakKontas.OAuth2.Google.Polly --version 1.0.0                
#r "nuget: BurakKontas.OAuth2.Google.Polly, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install BurakKontas.OAuth2.Google.Polly as a Cake Addin
#addin nuget:?package=BurakKontas.OAuth2.Google.Polly&version=1.0.0

// Install BurakKontas.OAuth2.Google.Polly as a Cake Tool
#tool nuget:?package=BurakKontas.OAuth2.Google.Polly&version=1.0.0                

BurakKontas.OAuth2.Google.Polly

Overview

BurakKontas.OAuth2.Google.Polly is a .NET package that integrates resilience patterns using Polly for handling OAuth2 authentication with Google. This package provides retry, circuit breaker, and fallback strategies to enhance the reliability of your OAuth2 authentication workflows.

Features

  • Retry Policy: Automatically retries failed requests with a configurable backoff strategy.
  • Circuit Breaker Policy: Prevents repeated execution of failing requests by breaking the circuit after a specified failure ratio.
  • Fallback Policy: Provides a fallback response when a request fails after retry and circuit breaker policies.

Installation

Add the package via NuGet:

dotnet add package BurakKontas.OAuth2.Google.Polly

Usage

1. Configure Dependency Injection

To use the resilience pipeline in your project, configure the dependency injection as shown below:

using BurakKontas.OAuth2.Google.Polly.Pipelines;

builder.Services.AddGooglePipeline();

2. Customize Policies (Optional)

You can customize the default policies by providing your own configuration:

services.AddGooglePipeline(pipelineBuilder =>
{
    // Customize policies here
});

Default Policies

  • Circuit Breaker: Breaks the circuit when the failure ratio exceeds 50% within 10 seconds.
  • Fallback: Provides a fallback response for HttpRequestException.
  • Retry: Retries up to 2 times with a constant delay of 2 seconds.

Contributing

We welcome contributions! To contribute, please fork the repository, create a new branch for your feature or bug fix, and submit a pull request. Make sure to follow the coding standards and include tests for any new functionality.

License

This project is licensed under the MIT License. Please review the license file for more details.

Repository

For more information, issues, and source code, please visit the GitHub Repository.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 111 9/1/2024