Skip to content

Commit f123666

Browse files
authored
Merge pull request #301 from Yubico/release/1.14.0
Release 1.14.0
2 parents 76777bb + 1527069 commit f123666

File tree

1,135 files changed

+5859
-3839
lines changed

Some content is hidden

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

1,135 files changed

+5859
-3839
lines changed

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
root = true
2-
# Copyright 2024 Yubico AB
2+
# Copyright 2025 Yubico AB
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License").
55
# You may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@ root = true
1919

2020
# IDE0073: File header
2121
dotnet_diagnostic.ide0073.severity = suggestion
22-
file_header_template = Copyright 2024 Yubico AB\n\nLicensed under the Apache License, Version 2.0 (the "License").\nYou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, \nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.
22+
file_header_template = Copyright 2025 Yubico AB\n\nLicensed under the Apache License, Version 2.0 (the "License").\nYou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS, \nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.
2323

2424
# ReSharper properties
2525
resharper_csharp_wrap_after_declaration_lpar = true

.github/copilot-instructions.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Copilot Instructions for Yubico.NET.SDK
2+
3+
This document provides instructions for the Copilot coding agent to work efficiently with the Yubico.NET.SDK repository.
4+
5+
## High-Level Details
6+
7+
- **Repository Summary**: The Yubico.NET.SDK is an enterprise-grade, cross-platform SDK for integrating YubiKey functionality into .NET applications. It provides APIs for device communication, cryptography, and management of YubiKey features. The protocols used include FIDO2, CTAPP, OATH, PIV, SCP3, SCP11 and OTP.
8+
- **Project Type**: This is a .NET library project, consisting of multiple sub-projects.
9+
- **Languages**: The primary language is C#.
10+
- **Frameworks and Runtimes**:
11+
- .NET Framework 4.7
12+
- .NET Standard 2.1
13+
- .NET 6 and later
14+
- **Key Dependencies**: The solution has a dependency on the `Yubico.NativeShims` project, which provides a stable ABI for P/Invoke operations.
15+
- The project makes use of an .editorconfig file to maintain consistent coding styles across the codebase.
16+
17+
## Build Instructions
18+
19+
To build, test, and validate changes, follow these steps.
20+
21+
### Building the Solution
22+
23+
You can build the entire solution from the root of the repository using the following command:
24+
25+
```bash
26+
dotnet build Yubico.NET.SDK.sln
27+
```
28+
29+
Alternatively, you can use the pre-configured build tasks in Visual Studio Code:
30+
31+
- `build project: Yubico.Yubikey`: Builds the `Yubico.YubiKey` project.
32+
- `dotnet: build`: A general-purpose build task.
33+
34+
### Running Tests
35+
36+
The repository contains both unit and integration tests.
37+
38+
- **Unit Tests**:
39+
- `run unit tests: Yubico.YubiKey`: Runs unit tests for the `Yubico.YubiKey` project.
40+
- `run unit tests: Yubico.Core`: Runs unit tests for the `Yubico.Core` project.
41+
42+
- **Integration Tests**:
43+
- Integration tests require a YubiKey plugged in and are categorized. You can run them using the provided tasks:
44+
- `run tests: integration (Simple)`
45+
- `run tests: integration (RequiresTouch)`
46+
- `run tests: integration (Elevated)`
47+
- `run tests: integration (RequiresBio)`
48+
- `run tests: integration (RequiresSetup)`
49+
- `run tests: integration (RequiresStepDebug)`
50+
- `run tests: integration (RequiresFips)`
51+
52+
## Project Layout
53+
54+
- **`Yubico.Core/`**: Contains the platform abstraction layer (PAL) for OS-specific functionality, device enumeration, and utility classes. It connects to devices such as HID and Smart Cards.
55+
- **`Yubico.YubiKey/`**: The primary assembly with all the classes and types for YubiKey interaction.
56+
- **`Yubico.NativeShims/`**: An internal project that provides a stable ABI for P/Invoke operations. It is not intended for public use. This is a C project that wraps native code for easier use in .NET.
57+
- **`contributordocs/`**: Contains detailed documentation for contributors, including coding guidelines, testing procedures, and code flow information.
58+
- **`.github/workflows/`**: Contains GitHub Actions workflows for continuous integration, including builds, tests, and code analysis.
59+
60+
## Validation and CI
61+
62+
The repository uses GitHub Actions for continuous integration. The following workflows are run on pull requests:
63+
64+
- `build.yml`: Builds the solution.
65+
- `build-nativeshims.yml`: Builds the native shims C project.
66+
- `test.yml`: Runs tests on macOS, Windows, and Ubuntu.
67+
- `codeql-analysis.yml`: Performs static code analysis using CodeQL.
68+
69+
Before submitting a pull request, ensure that your changes build successfully and that all relevant tests pass. Adhering to the coding style is also crucial.
70+
71+
## Documentation
72+
73+
The repository includes XML documentation comments for public APIs. To generate the documentation, use the following command:
74+
75+
```bash
76+
dotnet docfx docfx.json
77+
```
78+
79+
This will create a `docs` folder with the generated documentation.
80+
The published documentation can be found at `https://docs.yubico.com/yesdk/`. You may search this website for specific topics or API references.
81+
82+
## Exceptions
83+
The exceptions strings are stored in the ./Yubico.Core/src/Resources/ExceptionMessages.resx and ./Yubico.YubiKey/src/Resources/ExceptionMessages.cs files.

.github/workflows/build-nativeshims.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021 Yubico AB
1+
# Copyright 2025 Yubico AB
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.github/workflows/build-pull-requests.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021 Yubico AB
1+
# Copyright 2025 Yubico AB
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -52,7 +52,8 @@ jobs:
5252
with:
5353
global-json-file: global.json
5454

55-
- name: Add local NuGet repository
55+
# Add local NuGet repository so that we can use internal pre-release versions
56+
- name: Add local NuGet repository for prerelease versions
5657
run: dotnet nuget add source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/Yubico/index.json"
5758

5859
- name: Build Yubico.NET.SDK.sln

.github/workflows/build.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021 Yubico AB
1+
# Copyright 2025 Yubico AB
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -80,21 +80,23 @@ jobs:
8080
- uses: actions/setup-dotnet@v4
8181
with:
8282
global-json-file: "./global.json"
83-
- name: Add local NuGet repository
83+
84+
# Add local NuGet repository if version is not a plain release (i.e., has a suffix, e.g., -prerelease)
85+
- name: Add local NuGet repository for non-release versions
86+
if: ${{ github.event.inputs.version && (contains(github.event.inputs.version, '-')) }}
8487
run: dotnet nuget add source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/Yubico/index.json"
8588

86-
- name: Modify version for internal builds
87-
if: ${{ github.event.inputs.push-to-dev == 'true' }}
89+
- name: Set build version
90+
if: ${{ github.event.inputs.version }}
8891
run: |
8992
$file = gci ./build/Versions.props
9093
$versionProp = [xml](gc $file.FullName)
91-
$versionProp.Project.PropertyGroup.YubicoCoreVersion = "${{ github.event.inputs.version }}"
92-
$versionProp.Project.PropertyGroup.YubicoYubiKeyVersion = "${{ github.event.inputs.version }}"
94+
$versionProp.Project.PropertyGroup.CommonVersion = "${{ github.event.inputs.version }}"
9395
$versionProp.Save($file.FullName)
9496
9597
# Build the project
9698
- name: Build Yubico.NET.SDK.sln
97-
run: dotnet pack --configuration Release --nologo --verbosity minimal Yubico.NET.SDK.sln
99+
run: dotnet pack --configuration Release --nologo --verbosity minimal -p:treatWarningsAsErrors=true Yubico.NET.SDK.sln
98100

99101
# Build the documentation
100102
- name: Build docs
@@ -251,4 +253,4 @@ jobs:
251253
echo "| --- | --- |" >> $GITHUB_STEP_SUMMARY
252254
echo "| **Image Tag** | \`${{ env.DOCS_IMAGE_TAG }}\` |" >> $GITHUB_STEP_SUMMARY
253255
echo "| **Image Hash** | \`${{ env.DOCS_IMAGE_HASH }}\` |" >> $GITHUB_STEP_SUMMARY
254-
fi
256+
fi

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021 Yubico AB
1+
# Copyright 2025 Yubico AB
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.github/workflows/test-macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021 Yubico AB
1+
# Copyright 2025 Yubico AB
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.github/workflows/test-ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021 Yubico AB
1+
# Copyright 2025 Yubico AB
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.github/workflows/test-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021 Yubico AB
1+
# Copyright 2025 Yubico AB
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021 Yubico AB
1+
# Copyright 2025 Yubico AB
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)