Skip to content

Commit aab8fcc

Browse files
committed
✨ Project improvements.
1 parent 09bc5a3 commit aab8fcc

18 files changed

Lines changed: 393 additions & 100 deletions

.github/workflows/codeql.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: "CodeQL - C#"
22

33
on:
44
push:
5-
branches: [master, main]
5+
branches: [ master, main ]
66
pull_request:
7-
branches: [master, main]
7+
branches: [ master, main ]
88
schedule:
99
- cron: '0 4 * * 0' # Runs every Sunday at 4AM
1010

@@ -22,6 +22,11 @@ jobs:
2222
- name: Checkout repository
2323
uses: actions/checkout@v4
2424

25+
- name: Setup .NET 6.x
26+
uses: actions/setup-dotnet@v4
27+
with:
28+
dotnet-version: '6.x'
29+
2530
- name: Setup .NET 8.x
2631
uses: actions/setup-dotnet@v4
2732
with:

CODE_OF_CONDUCT.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for
6+
everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity
7+
and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion,
8+
or sexual identity and orientation.
9+
10+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
11+
12+
---
13+
14+
## Our Standards
15+
16+
Examples of behavior that contributes to a positive environment include:
17+
18+
- Demonstrating empathy and kindness toward other people
19+
- Being respectful of differing opinions, viewpoints, and experiences
20+
- Giving and gracefully accepting constructive feedback
21+
- Accepting responsibility and apologizing to those affected by our mistakes
22+
- Focusing on what is best not just for us as individuals, but for the overall community
23+
24+
Examples of unacceptable behavior include:
25+
26+
- The use of sexualized language or imagery, and sexual attention or advances of any kind
27+
- Trolling, insulting or derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others’ private information, such as a physical or email address, without their explicit permission
30+
- Other conduct which could reasonably be considered inappropriate in a professional setting
31+
32+
---
33+
34+
## Enforcement Responsibilities
35+
36+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take
37+
appropriate and fair corrective action in response to any behavior they deem inappropriate, threatening, offensive, or
38+
harmful.
39+
40+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
41+
issues, and other contributions that are not aligned with this Code of Conduct, and will communicate reasons for
42+
moderation decisions when appropriate.
43+
44+
---
45+
46+
## Scope
47+
48+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing
49+
the project or its community in public spaces.
50+
51+
---
52+
53+
## Enforcement
54+
55+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainer
56+
responsible for enforcement at our [GitHub repository](https://github.com/thenoobsbr/RestSharp.Authenticators.Digest).
57+
58+
All complaints will be reviewed and investigated promptly and fairly.
59+
60+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
61+
62+
---
63+
64+
## Attribution
65+
66+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.

CONTRIBUTING.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Contributing to RestSharp.Authenticators.Digest
2+
3+
Thank you for your interest in contributing to this project!
4+
Whether you're fixing a bug, adding a feature, improving documentation, or reporting an issue — your help is
5+
appreciated.
6+
7+
---
8+
9+
## 🧾 Table of Contents
10+
11+
- [How to contribute](#-how-to-contribute)
12+
- [Issue reporting](#-issue-reporting)
13+
- [Pull request guidelines](#-pull-request-guidelines)
14+
- [Development setup](#-development-setup)
15+
- [Code style and conventions](#-code-style-and-conventions)
16+
- [License](#-license)
17+
18+
---
19+
20+
## ✅ How to contribute
21+
22+
There are several ways to contribute:
23+
24+
- 🐛 Report a bug
25+
- ✨ Propose or implement a feature
26+
- 📝 Improve documentation
27+
- 🔧 Refactor or optimize existing code
28+
- ✅ Add tests or improve coverage
29+
30+
---
31+
32+
## 🐞 Issue reporting
33+
34+
If you've encountered a bug or unexpected behavior:
35+
36+
1. Search [existing issues](https://github.com/thenoobsbr/RestSharp.Authenticators.Digest/issues) to avoid duplicates.
37+
2. If none exists, open a **new issue** with:
38+
- Steps to reproduce
39+
- Expected behavior
40+
- Environment (.NET version, OS, etc.)
41+
- Error logs or test case (if available)
42+
43+
Clear, reproducible issues help us fix things faster.
44+
45+
---
46+
47+
## 🚀 Pull request guidelines
48+
49+
To contribute code:
50+
51+
1. Fork the repository
52+
2. Create a new branch:
53+
```bash
54+
git checkout -b feature/my-feature
55+
````
56+
3. Write your code and tests
57+
4. Run tests locally:
58+
```bash
59+
dotnet test
60+
```
61+
5. Commit using clear messages
62+
6. Push to your fork and open a PR against `main`
63+
64+
### PR checklist:
65+
66+
* ✅ Your code builds and tests pass
67+
* ✅ Follows the coding style (see below)
68+
* ✅ If you add functionality, include corresponding tests
69+
* ✅ Reference related issues in the PR (e.g., `Fixes #12`)
70+
71+
---
72+
73+
## 🧪 Development setup
74+
75+
You need:
76+
77+
* [.NET SDK 8.0+](https://dotnet.microsoft.com/download)
78+
* (Optionally) [.NET SDK 9.0](https://dotnet.microsoft.com/en-us/download/dotnet/9.0)
79+
* Git, an IDE (like Visual Studio or VS Code), and NuGet
80+
81+
Clone the repository:
82+
```bash
83+
git clone https://github.com/thenoobsbr/RestSharp.Authenticators.Digest.git
84+
cd RestSharp.Authenticators.Digest
85+
```
86+
87+
Run tests:
88+
```bash
89+
dotnet test
90+
```
91+
92+
---
93+
94+
## 🎯 Code style and conventions
95+
96+
*
97+
Use [C# standard conventions](https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions)
98+
* Prefer `async/await` over `Task.Result` or `.Wait()`
99+
* Use explicit access modifiers (`public`, `private`, etc.)
100+
* Tests follow the `Given_When_Then` pattern where appropriate
101+
102+
We recommend enabling automatic formatting with:
103+
104+
```bash
105+
dotnet format
106+
```
107+
108+
---
109+
110+
## 📄 License
111+
112+
By contributing, you agree that your code will be licensed under the [MIT License](LICENSE).

README.md

Lines changed: 78 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,37 @@
1-
# RestSharp.DigestAuthenticator
2-
Extends RestSharp features for digest authentication
1+
# RestSharp.Authenticators.Digest
32

4-
[![nuget](https://buildstats.info/nuget/RestSharp.Authenticators.Digest)](http://www.nuget.org/packages/RestSharp.Authenticators.Digest)
5-
![license](https://img.shields.io/github/license/thenoobsbr/RestSharp.Authenticators.Digest)
3+
A lightweight and extensible **Digest authentication plugin** for [RestSharp](https://github.com/restsharp/RestSharp),
4+
implemented as an `IAuthenticator`.
65

6+
[![NuGet](https://img.shields.io/nuget/v/RestSharp.Authenticators.Digest.svg)](https://www.nuget.org/packages/RestSharp.Authenticators.Digest/)
7+
[![License](https://img.shields.io/github/license/thenoobsbr/RestSharp.Authenticators.Digest)](LICENSE)
8+
![.NET Standard](https://img.shields.io/badge/.NET-Standard%202.0-blue)
9+
[![CodeQL - C#](https://github.com/thenoobsbr/RestSharp.Authenticators.Digest/actions/workflows/codeql.yml/badge.svg)](https://github.com/thenoobsbr/RestSharp.Authenticators.Digest/actions/workflows/codeql.yml)
710

8-
## Examples
9-
```CSharp
11+
---
12+
13+
## 📦 Installation
14+
15+
Install via [NuGet](https://www.nuget.org/packages/RestSharp.Authenticators.Digest):
16+
17+
```bash
18+
dotnet add package RestSharp.Authenticators.Digest
19+
````
20+
21+
---
22+
23+
## ✅ Compatibility
24+
25+
* .NET Standard 2.0
26+
* .NET Core 3.1+
27+
* .NET 5, 6, 7, 8, 9+
28+
* Fully compatible with `RestClient` from [RestSharp](https://github.com/restsharp/RestSharp)
29+
30+
---
31+
32+
## 🚀 Quick Usage
33+
34+
```csharp
1035
namespace Example
1136
{
1237
using RestSharp;
@@ -21,8 +46,8 @@ namespace Example
2146
{
2247
Authenticator = new DigestAuthenticator(USERNAME, PASSWORD)
2348
};
24-
25-
var client = new RestClient(restOptions);
49+
50+
var client = new RestClient(restOptions);
2651
var request = new RestRequest("values", Method.GET);
2752
request.AddHeader("Content-Type", "application/json");
2853
@@ -35,3 +60,48 @@ namespace Example
3560
}
3661
}
3762
```
63+
64+
---
65+
66+
## ✨ Features
67+
68+
* Implements HTTP Digest Authentication (RFC 7616)
69+
* Nonce and realm support
70+
* Compatible with servers that require `WWW-Authenticate: Digest`
71+
* Stateless and thread-safe
72+
* Works with `RestClient` and `IRestRequest` out of the box
73+
74+
---
75+
76+
## 🧪 Testing
77+
78+
Digest-authenticated servers can be mocked for integration testing using test frameworks or by hitting known
79+
Digest-protected endpoints.
80+
81+
Tests for multiple target frameworks (`net6.0`, `net8.0`, `net9.0`) are included.
82+
83+
---
84+
85+
## 📄 License
86+
87+
This project is licensed under the [MIT License](LICENSE).
88+
89+
---
90+
91+
## 🤝 Contributing
92+
93+
Contributions are welcome!
94+
95+
If you find a bug or have an idea for improvement:
96+
97+
* Open an [issue](https://github.com/thenoobsbr/RestSharp.Authenticators.Digest/issues)
98+
* Or submit a [pull request](https://github.com/thenoobsbr/RestSharp.Authenticators.Digest/pulls)
99+
100+
Please follow the [contribution guidelines](CONTRIBUTING.md) if available.
101+
102+
---
103+
104+
## 📬 Contact
105+
106+
Maintained by [@thenoobsbr](https://github.com/thenoobsbr)
107+
NuGet Package: [RestSharp.Authenticators.Digest](https://www.nuget.org/packages/RestSharp.Authenticators.Digest)

RELEASES.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
## v1.5.0
1010

11-
- Adjusts the nuget package;
11+
- Adjusts the nuget package;
1212
- Adds optional ILogger to the DigestAuthenticator constructor;
1313
- Adds optional request timeout to the DigestAuthenticator constructor;
1414

@@ -18,8 +18,8 @@
1818

1919
## v2.0.0
2020

21-
- Changes the compatibility to the RestSharp version `111.2.0` or greater.
21+
- Changes the compatibility to the RestSharp version `111.2.0` or greater.
2222

23-
## v2.0.1
23+
## v2.1.0
2424

25-
- Add ability to change client options from digest RestClient object
25+
- Add ability to change client options from digest RestClient object

RestSharp.Authenticators.Digest.sln

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1616
LICENSE = LICENSE
1717
README.md = README.md
1818
RELEASES.md = RELEASES.md
19+
CONTRIBUTING.md = CONTRIBUTING.md
20+
CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md
1921
EndProjectSection
2022
EndProject
2123
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DigestAuthenticator.Tests", "test\DigestAuthenticator.Tests\DigestAuthenticator.Tests.csproj", "{607B2AF3-A2CB-47D3-AA26-B8E79E93A4EE}"
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
1+
<wpf:ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib"
2+
xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xml:space="preserve">
24
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MD/@EntryIndexedValue">MD</s:String>
3-
<s:Boolean x:Key="/Default/UserDictionary/Words/=codeql/@EntryIndexedValue">True</s:Boolean>
4-
<s:Boolean x:Key="/Default/UserDictionary/Words/=danielpalme/@EntryIndexedValue">True</s:Boolean>
5-
<s:Boolean x:Key="/Default/UserDictionary/Words/=reporttypes/@EntryIndexedValue">True</s:Boolean>
6-
<s:Boolean x:Key="/Default/UserDictionary/Words/=targetdir/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
5+
<s:Boolean x:Key="/Default/UserDictionary/Words/=codeql/@EntryIndexedValue">True</s:Boolean>
6+
<s:Boolean x:Key="/Default/UserDictionary/Words/=danielpalme/@EntryIndexedValue">True</s:Boolean>
7+
<s:Boolean x:Key="/Default/UserDictionary/Words/=reporttypes/@EntryIndexedValue">True</s:Boolean>
8+
<s:Boolean x:Key="/Default/UserDictionary/Words/=targetdir/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using System.Reflection;
2+
3+
namespace RestSharp.Authenticators.Digest;
4+
5+
internal static class AssemblyMarker
6+
{
7+
public static Assembly Self => typeof(AssemblyMarker).Assembly;
8+
}

0 commit comments

Comments
 (0)