Skip to content

Commit 444a49e

Browse files
author
Mihkel Kivisild
committed
Merging web-eid-asp-dotnet-example repository into web-eid-authtoken-validation-dotnet repository
WE2-933 Signed-off-by: Mihkel Kivisild <[email protected]>
1 parent bbd6281 commit 444a49e

Some content is hidden

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

51 files changed

+3674
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Dotnet build example
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- name: Setup dotnet
13+
uses: actions/setup-dotnet@v4
14+
with:
15+
dotnet-version: 8.0.x # SDK Version to use.
16+
17+
- name: Cache Nuget packages
18+
uses: actions/cache@v4
19+
with:
20+
path: ~/.nuget/packages
21+
# Look to see if there is a cache hit for the corresponding requirements file
22+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
23+
restore-keys: ${{ runner.os }}-nuget
24+
25+
- name: Install dependencies
26+
run: dotnet restore WebEid.AspNetCore.Example.sln --source "https://gitlab.com/api/v4/projects/35362906/packages/nuget/index.json" --source "https://api.nuget.org/v3/index.json"
27+
working-directory: ./example
28+
29+
- name: Download RIA repository public key
30+
run: wget https://github.com/web-eid/web-eid-asp-dotnet-example/raw/main/example/ria_public_key.gpg
31+
32+
- name: Copy RIA repository key to keyrings
33+
run: sudo cp ria_public_key.gpg /usr/share/keyrings/ria-repository.gpg
34+
35+
- name: Add RIA repository to APT
36+
run: |
37+
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
38+
39+
- name: Update APT and install libdigidocpp-csharp
40+
run: |
41+
sudo apt update
42+
sudo apt install -y --no-install-recommends libdigidocpp-csharp
43+
44+
- name: Copy the necessary DigiDoc C# library files
45+
run: sudo cp /usr/include/digidocpp_csharp/* WebEid.AspNetCore.Example/DigiDoc/
46+
working-directory: ./example
47+
48+
- name: Build
49+
run: dotnet publish --configuration Release --no-restore WebEid.AspNetCore.Example.sln --verbosity normal
50+
working-directory: ./example
51+
52+
- name: Test
53+
run: dotnet test --no-restore --verbosity normal WebEid.AspNetCore.Example.sln
54+
working-directory: ./example
55+
56+
- name: Test building Docker image
57+
run: docker build -t web-eid-asp-dotnet-example .
58+
working-directory: ./example

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,3 +429,6 @@ ChallengeNonce challengeNonce = nonceGenerator.GenerateAndStoreNonce(timeToLive)
429429
```
430430

431431
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.
432+
433+
# Web eID ASP.NET example
434+
See the [example documentation](example/README.md).

0 commit comments

Comments
 (0)