Skip to content

Commit 72f5a36

Browse files
authored
Various cleanup (#558)
* Various cleanup * dotnet format --------- Co-authored-by: joegoldman2 <[email protected]>
1 parent 455f428 commit 72f5a36

File tree

96 files changed

+296
-296
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+296
-296
lines changed

.github/workflows/main.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ env:
2626
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
2727
DOTNET_NOLOGO: true
2828
DOTNET_CLI_TELEMETRY_OPTOUT: true
29-
29+
3030
jobs:
3131
# Determine version
3232
version:
@@ -43,7 +43,7 @@ jobs:
4343
echo "Invalid version: ${{ github.event.release.tag_name }}"
4444
exit 1
4545
fi
46-
46+
4747
echo "version=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
4848
4949
- name: Determine prerelease version
@@ -94,7 +94,7 @@ jobs:
9494
- name: Install .NET
9595
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3
9696
with:
97-
dotnet-version: |
97+
dotnet-version: |
9898
6.0.x
9999
8.0.x
100100
@@ -133,7 +133,7 @@ jobs:
133133
- name: Install .NET
134134
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3
135135
with:
136-
dotnet-version: |
136+
dotnet-version: |
137137
6.0.x
138138
8.0.x
139139
@@ -147,7 +147,7 @@ jobs:
147147
--configuration Release
148148
-p:ContinuousIntegrationBuild=true
149149
-p:Version=${{ needs.version.outputs.version }}
150-
150+
151151
- name: Run pack
152152
run: >
153153
dotnet pack
@@ -186,7 +186,7 @@ jobs:
186186
- name: Install .NET
187187
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3
188188
with:
189-
dotnet-version: |
189+
dotnet-version: |
190190
6.0.x
191191
8.0.x
192192

.github/workflows/release-drafter.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ jobs:
1313
# Drafts your next Release notes as Pull Requests are merged into "master"
1414
- uses: release-drafter/release-drafter@v5
1515
env:
16-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

BlazorWasmDemo/Client/wwwroot/css/open-iconic/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
## What's in Open Iconic?
99

1010
* 223 icons designed to be legible down to 8 pixels
11-
* Super-light SVG files - 61.8 for the entire set
11+
* Super-light SVG files - 61.8 for the entire set
1212
* SVG sprite&mdash;the modern replacement for icon fonts
1313
* Webfont (EOT, OTF, SVG, TTF, WOFF), PNG and WebP formats
1414
* Webfont stylesheets (including versions for Bootstrap and Foundation) in CSS, LESS, SCSS and Stylus formats
@@ -33,7 +33,7 @@ We like SVGs and we think they're the way to display icons on the web. Since Ope
3333

3434
Open Iconic also comes in a SVG sprite which allows you to display all the icons in the set with a single request. It's like an icon font, without being a hack.
3535

36-
Adding an icon from an SVG sprite is a little different than what you're used to, but it's still a piece of cake. *Tip: To make your icons easily style able, we suggest adding a general class to the* `<svg>` *tag and a unique class name for each different icon in the* `<use>` *tag.*
36+
Adding an icon from an SVG sprite is a little different than what you're used to, but it's still a piece of cake. *Tip: To make your icons easily style able, we suggest adding a general class to the* `<svg>` *tag and a unique class name for each different icon in the* `<use>` *tag.*
3737

3838
```
3939
<svg class="icon">

BlazorWasmDemo/Server/Properties/launchSettings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@
3434
"sslPort": 44312
3535
}
3636
}
37-
}
37+
}

CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# FIDO2 .NET library (WebAuthn)
22

3-
[Readme](https://github.com/passwordless-lib/fido2-net-lib/blob/master/README.md)
3+
[Readme](https://github.com/passwordless-lib/fido2-net-lib/blob/master/README.md)
44

55
2020-03-24 1.1.0
66
- Refactored FIDO2 model
@@ -11,4 +11,4 @@
1111
- Conformance tool recently changed the way EdDSA signatures are verified. This fix passes the test in v1.1.6.
1212

1313
2019-07-31 1.0.1
14-
- initial release FIDO2 .NET library (WebAuthn)
14+
- initial release FIDO2 .NET library (WebAuthn)

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ OS's use different variable names to represent similar settings. Code should con
5151
For example, when looking for the user's home directory, on Windows the variable is `USERPROFILE` but on most Linux systems it is `HOME`.
5252

5353
```cs
54-
var homeDir = Environment.GetEnvironmentVariable("USERPROFILE")
54+
var homeDir = Environment.GetEnvironmentVariable("USERPROFILE")
5555
?? Environment.GetEnvironmentVariable("HOME");
5656
```
5757

Demo/.config/dotnet-tools.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
]
1010
}
1111
}
12-
}
12+
}

Demo/Demo.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
44
<TargetFramework>net8.0</TargetFramework>

Demo/Properties/launchSettings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323
"applicationUrl": "http://localhost:4729/;https://localhost:44329/"
2424
}
2525
}
26-
}
26+
}

Demo/appsettings.Development.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
{
22
"Logging": {
33
"IncludeScopes": false,
44
"LogLevel": {

Demo/appsettings.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
{
1+
{
22
"fido2": {
33
"serverDomain": "localhost",
44
"origins": [ "https://localhost:44329" ],
55
"timestampDriftTolerance": 300000,
66
"backupEligibleCredentialPolicy": "allowed",
77
"backedUpCredentialPolicy": "allowed"
8-
},
8+
},
99
"Logging": {
1010
"IncludeScopes": false,
1111
"LogLevel": {

Demo/bundleconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Configure bundling and minification for the project.
1+
// Configure bundling and minification for the project.
22
// More info at https://go.microsoft.com/fwlink/?LinkId=808241
33
[
44
{

Demo/launchSettings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
"sslPort": 44329
88
}
99
}
10-
}
10+
}

Demo/wwwroot/js/.eslintrc.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
{
1+
{
22
"env": {"es6": true}
3-
}
3+
}

Documentation/NET46X.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ TypeLoadExceptions for types like "ECPoint" - essentially breaking the functiona
1919
## FI0404
2020

2121
Because NuGet doesn't give us the ability to reduce these frameworks from the .NET Standard restore graphs,
22-
we have to fall back to MSBuild errors preventing you to even build a project with the offending configurations.
22+
we have to fall back to MSBuild errors preventing you to even build a project with the offending configurations.

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# FIDO2 .NET Library (WebAuthn)
2-
A working implementation library + demo for [FIDO2](https://fidoalliance.org/fido2/) and [WebAuthn](https://www.w3.org/TR/webauthn/) using [.NET](https://dotnet.microsoft.com/)
2+
A working implementation library + demo for [FIDO2](https://fidoalliance.org/fido2/) and [WebAuthn](https://www.w3.org/TR/webauthn/) using [.NET](https://dotnet.microsoft.com/)
33
[![Build Status](https://dev.azure.com/anders/Fido2/_apis/build/status/abergs.fido2-net-lib?branchName=master)](https://dev.azure.com/anders/Fido2/_build/latest?definitionId=10&branchName=master)
44
[![codecov](https://codecov.io/gh/passwordless-lib/fido2-net-lib/branch/master/graph/badge.svg)](https://codecov.io/gh/passwordless-lib/fido2-net-lib)
55
[![Financial Contributors on Open Collective](https://opencollective.com/passwordless/all/badge.svg?label=financial+contributors)](https://opencollective.com/passwordless)
@@ -23,7 +23,7 @@ This project is part of the [.NET foundation](https://dotnetfoundation.org)
2323

2424
```Install-Package Fido2```
2525

26-
To use the asp.net helpers, install the asp.net-package.
26+
To use the asp.net helpers, install the asp.net-package.
2727

2828
```Install-Package Fido2.AspNet```
2929

@@ -33,28 +33,28 @@ To use the asp.net helpers, install the asp.net-package.
3333
* [Code examples](#examples)
3434

3535
## What is FIDO2?
36-
**The passwordless web is coming.**
36+
**The passwordless web is coming.**
3737
[FIDO2](https://fidoalliance.org/fido2/) / [WebAuthn](https://www.w3.org/TR/webauthn/) is a new open authentication standard, supported by [browsers](https://www.w3.org/Consortium/Member/List) and [many large tech companies](https://fidoalliance.org/members/) such as Microsoft, Google etc. The main driver is to allow a user to login without passwords, creating *passwordless flows* or strong MFA for user signup/login on websites. The standard is not limited to web applications with support coming to Active Directory and native apps. The technology builds on public/private keys, allowing authentication to happen without sharing a secret between the user & platform. This brings many benefits, such as easier and safer logins and makes phishing attempts extremely hard.
3838

39-
Read more:
39+
Read more:
4040
- [Why it's exciting](http://ideasof.andersaberg.com/development/the-passwordless-web)
4141
- [Medium](https://blog.tokenize.com/fido-2-0-what-is-it-and-why-are-we-excited-31a66df6e113)
4242
- [FIDO Alliance](https://fidoalliance.org/fido2/)
4343
- [Yubico](https://www.yubico.com/2018/08/10-things-youve-been-wondering-about-fido2-webauthn-and-a-passwordless-world/)
4444
- [WebAuthn.Guide](https://webauthn.guide/) from Duo Security
45-
- [WebAuthn.io](https://webauthn.io/)
45+
- [WebAuthn.io](https://webauthn.io/)
4646
- [WebAuthn Awesome](https://github.com/herrjemand/WebauthnAwesome)
4747

4848
## Supported features
4949

50-
- ✅ Attestation API & verification (Register and verify credentials/authenticators)
50+
- ✅ Attestation API & verification (Register and verify credentials/authenticators)
5151
- ✅ Assertion API & verification (Authenticate users)
5252
- ✅ 100% pass rate in [conformance testing](#conformance-testing-tool) ([results](https://github.com/passwordless-lib/fido2-net-lib/issues/13#issuecomment-457318859))
5353
- ✅ FIDO2 security keys aka roaming authenticators ([spec](https://www.w3.org/TR/webauthn/#roaming-authenticators)), like SoloKeys [Solo](https://github.com/solokeys/solo/blob/master/README.md), Yubico [YubiKey](https://www.yubico.com/products/yubikey-hardware/), and Feitian [BioPass FIDO2](https://www.ftsafe.com/Products/FIDO2))
5454
- ✅ Device embedded authenticators aka platform authenticators ([spec](https://www.w3.org/TR/webauthn/#platform-authenticators)), like [Android Key](https://source.android.com/security/keystore/attestation) and [TPM](https://trustedcomputinggroup.org/resource/trusted-platform-module-2-0-a-brief-introduction/))
5555
- ✅ Backwards compatibility with FIDO U2F authenticators ([spec](https://www.w3.org/TR/#conforming-authenticators-u2f))
56-
-[Windows Hello](https://docs.microsoft.com/en-us/microsoft-edge/dev-guide/windows-integration/web-authentication)
57-
-[Face ID and Touch ID for the Web](https://webkit.org/blog/11312/meet-face-id-and-touch-id-for-the-web/) (aka "Apple Hello")
56+
-[Windows Hello](https://docs.microsoft.com/en-us/microsoft-edge/dev-guide/windows-integration/web-authentication)
57+
-[Face ID and Touch ID for the Web](https://webkit.org/blog/11312/meet-face-id-and-touch-id-for-the-web/) (aka "Apple Hello")
5858
- ✅ All currently referenced cryptographic algorithms for FIDO2 Server ([spec](https://fidoalliance.org/specs/fido-v2.0-rd-20180702/fido-server-v2.0-rd-20180702.html#other))
5959
- ✅ All current attestation formats: "packed", "tpm", "android-key", "android-safetynet", "fido-u2f", "apple", "apple-appattest", and "none" ([spec](https://www.iana.org/assignments/webauthn/webauthn.xhtml))
6060
- ✅ FIDO2 Server attestation validation via FIDO Metadata Service V3 ([spec](https://fidoalliance.org/specs/mds/fido-metadata-service-v3.0-ps-20210518.html))
@@ -209,7 +209,7 @@ https://www.nuget.org/packages/Fido2/ and https://www.nuget.org/packages/Fido2.M
209209
See [Contributing](CONTRIBUTING.md) for information about contributing to the project.
210210

211211
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
212-
For more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
212+
For more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
213213

214214
For security and penetration testing, please see our [Vulnerability Disclosure Program](./VDP.md)
215215

SPONSORS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ Backer / Plaintext
22
* Veikko Eeva
33

44
Donated
5-
* Jure Purgar
5+
* Jure Purgar

Src/Fido2.AspNet/DistributedCacheMetadataService.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ protected virtual DateTimeOffset GetMemoryCacheAbsoluteExpiryTime(DateTimeOffset
6969
var expiryTime = _systemClock.UtcNow.GetNextIncrement(_defaultMemoryCacheInterval);
7070

7171
//Ensure that memory cache expiry time never exceeds the next update time from the service
72-
if (nextUpdateTime.HasValue && expiryTime > nextUpdateTime.Value)
72+
if (nextUpdateTime.HasValue && expiryTime > nextUpdateTime.Value)
7373
expiryTime = nextUpdateTime.Value;
7474

7575
return expiryTime;
@@ -107,7 +107,7 @@ await _distributedCache.SetStringAsync(
107107
new DistributedCacheEntryOptions()
108108
{
109109
AbsoluteExpiration = GetDistributedCacheAbsoluteExpiryTime(GetNextUpdateTimeFromPayload(payload))
110-
},
110+
},
111111
cancellationToken);
112112
}
113113

Src/Fido2.AspNet/Fido2.AspNet.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFrameworks>$(SupportedTargetFrameworks)</TargetFrameworks>

Src/Fido2.BlazorWebAssembly/Fido2.BlazorWebAssembly.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Razor">
1+
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
44
<TargetFrameworks>$(SupportedTargetFrameworks)</TargetFrameworks>

Src/Fido2.BlazorWebAssembly/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
{
22
"compileOnSave": true,
33
"compilerOptions": {
44
"noImplicitAny": true,

Src/Fido2.Ctap2/Commands/AuthenticatorMakeCredentialCommand.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public AuthenticatorMakeCredentialCommand(
3030
public byte[] ClientDataHash { get; }
3131

3232
/// <summary>
33-
/// This PublicKeyCredentialRpEntity data structure describes a Relying Party with which the new public key credential will be associated.
34-
/// It contains the Relying party identifier of type text string, (optionally) a human-friendly RP name of type text string, and (optionally) a URL of type text string, referencing a RP icon image.
33+
/// This PublicKeyCredentialRpEntity data structure describes a Relying Party with which the new public key credential will be associated.
34+
/// It contains the Relying party identifier of type text string, (optionally) a human-friendly RP name of type text string, and (optionally) a URL of type text string, referencing a RP icon image.
3535
/// </summary>
3636
[CborMember(0x02)]
3737
public PublicKeyCredentialRpEntity Rp { get; }
@@ -46,7 +46,7 @@ public AuthenticatorMakeCredentialCommand(
4646
public PubKeyCredParam[] PubKeyCredParams { get; }
4747

4848
/// <summary>
49-
/// The authenticator returns an error if the authenticator already contains one of the credentials enumerated in this sequence.
49+
/// The authenticator returns an error if the authenticator already contains one of the credentials enumerated in this sequence.
5050
/// This allows RPs to limit the creation of multiple credentials for the same account on a single authenticator.
5151
/// </summary>
5252
[CborMember(0x05)]
@@ -104,7 +104,7 @@ public AuthenticatorMakeCredentialCommand(
104104

105105
if (Options is AuthenticatorMakeCredentialOptions options)
106106
{
107-
// 0x07 : options
107+
// 0x07 : options
108108
cbor.Add(0x07, options.ToCborObject());
109109
}
110110

Src/Fido2.Ctap2/Fido2.Ctap2.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFrameworks>$(SupportedTargetFrameworks)</TargetFrameworks>

Src/Fido2.Ctap2/Responses/AuthenticatorClientPinResponse.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public sealed class AuthenticatorClientPinResponse
77
{
88
/// <summary>
99
/// Authenticator key agreement public key in COSE_Key format.
10-
/// This will be used to establish a sharedSecret between platform and the authenticator.
10+
/// This will be used to establish a sharedSecret between platform and the authenticator.
1111
/// The COSE_Key-encoded public key MUST contain the optional "alg" parameter and MUST NOT contain any other optional parameters.
1212
/// The "alg" parameter MUST contain a COSEAlgorithmIdentifier value.
1313
/// </summary>

Src/Fido2.Ctap2/Responses/AuthenticatorGetAssertionResponse.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ public sealed class AuthenticatorGetAssertionResponse
4040
public PublicKeyCredentialUserEntity? User { get; set; }
4141

4242
/// <summary>
43-
/// Total number of account credentials for the RP.This member is required when more than one account for the RP and the authenticator does not have a display.
43+
/// Total number of account credentials for the RP.This member is required when more than one account for the RP and the authenticator does not have a display.
4444
/// Omitted when returned for the authenticatorGetNextAssertion method.
4545
/// </summary>
4646
[CborMember(0x05)]
4747
public int? NumberOfCredentials { get; set; }
4848

4949
/// <summary>
50-
/// Indicates that a credential was selected by the user via interaction directly with the authenticator, and thus the platform does not need to confirm the credential.
50+
/// Indicates that a credential was selected by the user via interaction directly with the authenticator, and thus the platform does not need to confirm the credential.
5151
/// MUST NOT be present in response to a request where an allowList was given, where numberOfCredentials is greater than one, nor in response to an authenticatorGetNextAssertion request.
5252
/// </summary>
5353
[CborMember(0x06)]

Src/Fido2.Ctap2/Responses/AuthenticatorGetInfoResponse.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public sealed class AuthenticatorGetInfoResponse
1919
public string[] Extensions { get; set; }
2020

2121
/// <summary>
22-
/// The claimed AAGUID.
22+
/// The claimed AAGUID.
2323
/// 16 bytes in length and encoded the same as MakeCredential AuthenticatorData, as specified in [WebAuthn].
2424
/// </summary>
2525
[CborMember(0x03)]

Src/Fido2.Ctap2/Responses/AuthenticatorMakeCredentialResponse.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static AuthenticatorMakeCredentialResponse FromCborObject(CborObject cbor
4646
{
4747
switch ((int)key)
4848
{
49-
#pragma warning disable format
49+
#pragma warning disable format
5050
case 0x01: result.Fmt = (string)value; break;
5151
case 0x02: result.AuthData = (byte[])value; break;
5252
case 0x03: result.AttStmt = (CborMap)value; break;

Src/Fido2.Development/Fido2.Development.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFrameworks>$(SupportedTargetFrameworks)</TargetFrameworks>

Src/Fido2.Development/StoredCredential.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ public class StoredCredential
3737
public bool IsBackedUp { get; set; }
3838

3939
/// <summary>
40-
/// The value of the attestationObject attribute when the public key credential source was registered.
40+
/// The value of the attestationObject attribute when the public key credential source was registered.
4141
/// Storing this enables the Relying Party to reference the credential's attestation statement at a later time.
4242
/// </summary>
4343
public byte[] AttestationObject { get; set; }
4444

4545
/// <summary>
46-
/// The value of the clientDataJSON attribute when the public key credential source was registered.
46+
/// The value of the clientDataJSON attribute when the public key credential source was registered.
4747
/// Storing this in combination with the above attestationObject item enables the Relying Party to re-verify the attestation signature at a later time.
4848
/// </summary>
4949
public byte[] AttestationClientDataJson { get; set; }

0 commit comments

Comments
 (0)