Skip to content

Merging web-eid-asp-dotnet-example repository into web-eid-authtoken-validation-dotnet repository #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/dotnet-build-example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Dotnet build example

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./example

steps:
- uses: actions/checkout@v4

- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x # SDK Version to use.

- name: Cache Nuget packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: ${{ runner.os }}-nuget

- name: Install dependencies
run: dotnet restore src/WebEid.AspNetCore.Example.sln --source "https://gitlab.com/api/v4/projects/35362906/packages/nuget/index.json" --source "https://api.nuget.org/v3/index.json"

- name: Copy RIA repository key to keyrings
run: sudo cp src/ria_public_key.gpg /usr/share/keyrings/ria-repository.gpg

- name: Add RIA repository to APT
run: |
echo "deb [signed-by=/usr/share/keyrings/ria-repository.gpg] https://installer.id.ee/media/ubuntu/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/ria-repository.list

- name: Update APT and install libdigidocpp-csharp
run: |
sudo apt update
sudo apt install -y --no-install-recommends libdigidocpp-csharp

- name: Copy the necessary DigiDoc C# library files
run: sudo cp /usr/include/digidocpp_csharp/* src/WebEid.AspNetCore.Example/DigiDoc/

- name: Build
run: dotnet publish --configuration Release --no-restore src/WebEid.AspNetCore.Example.sln --verbosity normal

- name: Test
run: dotnet test --no-restore --verbosity normal src/WebEid.AspNetCore.Example.sln

- name: Test building Docker image
run: docker build -t web-eid-asp-dotnet-example .
working-directory: ./example/src
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,3 +429,6 @@ ChallengeNonce challengeNonce = nonceGenerator.GenerateAndStoreNonce(timeToLive)
```

The `GenerateAndStoreNonce(TimeSpan ttl)` method both generates the nonce and stores it in the store. The `ttl` parameter defines nonce time-to-live duration. When the time-to-live passes, the nonce is considered to be expired.

# Web eID ASP.NET example
See the [example documentation](example/README.md).
Loading