Skip to content

Commit 8b15572

Browse files
committed
Update menu URLs and remove outdated content for DevOps and Infrastructures sections
1 parent 1937c3f commit 8b15572

File tree

5 files changed

+193
-23
lines changed

5 files changed

+193
-23
lines changed

config/_default/menus/menus.en.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
[[templates]]
4646
name = "Library"
4747
identifier = "library-dotnet-template"
48-
url = "/it/templates/library-template/"
48+
url = "/templates/library-template/"
4949
weight = 90
5050

5151
[[templates]]
@@ -58,13 +58,13 @@
5858
[[main]]
5959
name = "Infrastructures"
6060
identifier = "infrastructure"
61-
url = "/containers/"
61+
url = "/infrastructure/"
6262
weight = 110
6363

6464
[[main]]
6565
name = "DevOps"
6666
identifier = "devops"
67-
url = "/containers/"
67+
url = "/devops/"
6868
weight = 120
6969

7070
####################################

content/en/devops/_index.md renamed to content/en/devops/index.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,51 @@
11
---
2-
title : "Containers"
3-
description: "How to containerize your solution!"
4-
lead: "Containerizing applications is mandatory step for modern enterprise applications. Genocs Library contains containers setup as well!"
5-
date: 2023-05-13T15:40:19+02:00
2+
title : "DevOps"
3+
description: "How to setup your DevOps pipeline!"
4+
lead: "How to setup your DevOps pipeline!"
5+
date: 2025-10-11T15:40:19+02:00
66
lastmod: 2025-10-11T15:34:50Z
77
draft: false
88
images: []
99
---
1010

11-
Setup Kubernetes cluster to be production ready isn't a simple task. It requires to take in consideration many topics.
11+
Setup DevOps pipeline to be production ready isn't a simple task. It requires to take in consideration many topics.
1212

13-
In this walkthrough we will setup the steps required to have a Kubernetes cluster up and running.
13+
In this walkthrough we will setup the steps required to have a DevOps pipeline up and running.
1414

1515
This proposal is thought as to be used on Azure, even though most of the options could be reused for any cloud provider like Google Cloud or AWS.
1616

17-
{{<img src="gnx-library_v1.png">}}
17+
<img src="/images/gnx-ci-cd-pipeline.svg" alt=".NET">
1818

1919
## Prerequisites
2020

21-
- **Azure Subscription** to create AKS cluster
22-
- **kubectl** logged into Kubernetes cluster
21+
- **Azure Subscription** to create Azure DevOps project
22+
- **kubectl** logged into Azure DevOps project
2323
- **PowerShell**
2424
- **Postman**
2525
- **Helm**
2626
- **DockerHub account** (optional)
27+
- **Github account** (optional)
2728

2829
## Introduction
2930

30-
The setup is spitted into different steps:
31+
The setup is split into different steps:
3132

3233
- Bare components
3334
- Security
34-
- Scaling
35+
- CI/CD
3536
- Monitoring
3637
- Application
3738

3839
## Setup - Overview
3940

40-
During this step we are going to setup Kubernetes cluster tackling the following components:
41+
During this step we are going to setup Azure DevOps project tackling the following components:
4142

4243
- Setup private Docker images repository
43-
- Setup the Kubernetes cluster
44+
- Setup the Azure DevOps project
4445
- Setup the Vault for secrets
4546
- Secure secrets
4647
- Setup networking
47-
- Setup autoscaler
48+
- Setup CI/CD
4849

4950
### Monitoring
5051

content/en/infrastructures/_index.md renamed to content/en/infrastructures/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
---
2-
title : "Containers"
3-
description: "How to containerize your solution!"
4-
lead: "Containerizing applications is mandatory step for modern enterprise applications. Genocs Library contains containers setup as well!"
2+
title : "Infrastructures"
3+
description: "How to setup your infrastructure!"
4+
lead: "How to setup your infrastructure!"
55
date: 2023-05-13T15:40:19+02:00
66
lastmod: 2025-10-11T15:34:50Z
77
draft: false
88
images: []
99
---
1010

11-
Setup Kubernetes cluster to be production ready isn't a simple task. It requires to take in consideration many topics.
11+
Modern application requires to be hosted on an infrastructure to be production ready. It requires to take in consideration many topics.
1212

13-
In this walkthrough we will setup the steps required to have a Kubernetes cluster up and running.
13+
In this walkthrough we will setup the steps required to have an infrastructure up and running on Azure.
1414

1515
This proposal is thought as to be used on Azure, even though most of the options could be reused for any cloud provider like Google Cloud or AWS.
1616

1717
{{<img src="gnx-k8s-architecture">}}
1818

1919
## Prerequisites
2020

21-
- **Azure Subscription** to create AKS cluster
21+
- **Azure Subscription** to create Kubernetes cluster
2222
- **kubectl** logged into Kubernetes cluster
2323
- **PowerShell**
2424
- **Postman**
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
---
2+
title: "Authorization"
3+
description: "Adds the integration with authorization middleware and system components to validate and grant the access to the resources."
4+
lead: ""
5+
date: 2023-05-13T15:40:19+02:00
6+
lastmod: 2025-10-11T16:18:19Z
7+
draft: false
8+
images: []
9+
menu:
10+
library:
11+
identifier: "authorization"
12+
name: "Authorization"
13+
parent: "library"
14+
weight: 2
15+
toc: true
16+
---
17+
18+
## Installation
19+
20+
```bash
21+
dotnet add package Genocs.Auth
22+
```
23+
24+
## Dependencies
25+
26+
- Genocs.Core
27+
- Genocs.Security
28+
29+
## Usage
30+
31+
This module provides the integration with authorization middleware and system components to validate and grant the access to the resources.
32+
33+
The Genocs Authorization module provides the following features:
34+
35+
- Authorization middleware
36+
- Authorization system components
37+
- Authorization policies
38+
- Authorization handlers
39+
- Authorization attributes
40+
41+
42+
In order to provide multiple authorization strategies and to be able to authorize the access to the resource for different purposes like FrontEnd Application and/or MCP services, the Genocs Authorization module provides the following features:
43+
44+
- Authorization for FrontEnd Application
45+
- Authorization for MCP services
46+
47+
48+
The Authorization is made by using endpoint decorators and policies.
49+
50+
## How to enable the authorization
51+
Extend `IGenocsBuilder` with `AddOpenIdJwt()` that will register the required services.
52+
53+
```cs
54+
public static IGenocsBuilder RegisterGenocs(this IGenocsBuilder builder)
55+
{
56+
builder.AddOpenIdJwt()
57+
// Other services.
58+
59+
60+
// Return the Genocs builder to be used to chain other services
61+
return builder;
62+
}
63+
64+
65+
public static IApplicationBuilder UseCustomAuthentication(this IApplicationBuilder builder)
66+
{
67+
// Custom middleware to allow both Jwt and ApiKey authentication
68+
builder.UseMiddleware<JwtOrApiKeyAuthenticationMiddleware>();
69+
70+
// Return the Application builder to be used to chain other services
71+
return builder;
72+
}
73+
```
74+
75+
### Endpoint decorators
76+
77+
Upone the registration of the authorization services, you can use the following decorators to authorize the access to the resources:
78+
79+
```cs
80+
[ApiKeyOrJwtAuthorize]
81+
```
82+
83+
```cs
84+
[Authorize(Roles = "Editor")]
85+
```
86+
87+
### Example
88+
89+
The example below shows how to authorize the access to the resources using the `Authorize` decorator, you can also use the `ApiKeyOrJwtAuthorize` decorator to authorize the access to the resources using the `ApiKey` or `Jwt` authentication.
90+
91+
92+
```cs
93+
/// <summary>
94+
/// Retrieves authorization information for the authenticated user.
95+
/// </summary>
96+
/// <remarks>
97+
/// <para>
98+
/// This endpoint demonstrates JWT authorization by returning the authorization header
99+
/// from the authenticated request. It serves as a simple test to verify that JWT
100+
/// authentication is working correctly.
101+
/// </para>
102+
/// <para>**Important:** This endpoint requires the user to have the 'Editor' role.</para>
103+
/// <para>Sample request:</para>
104+
/// <para>
105+
/// GET /JwtAuthorized
106+
/// Authorization: Bearer your-jwt-token-here
107+
/// </para>
108+
///
109+
/// </remarks>
110+
/// <returns>A string containing the authorization header value from the request.</returns>
111+
/// <response code="200">Returns the authorization header information successfully.</response>
112+
/// <response code="401">Unauthorized - Invalid or missing JWT token.</response>
113+
/// <response code="403">Forbidden - Valid token but user lacks the required 'Editor' role.</response>
114+
[HttpGet("")]
115+
[Authorize(Roles = "Editor")]
116+
[ProducesResponseType(typeof(string), StatusCodes.Status200OK)]
117+
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
118+
[ProducesResponseType(StatusCodes.Status403Forbidden)]
119+
public async Task<IActionResult> GetAuthorizedAsync()
120+
{
121+
_logger.LogInformation("Processing authorized request for user");
122+
123+
return await Task.Run(() => Ok($"Done! Authorization is: {HttpContext.Request.Headers.Authorization}"));
124+
}
125+
```
126+
127+
128+
## Options
129+
130+
The default section name for the authorization settings is `authorization`. The following options are available:
131+
132+
- `enabled` - If true then the authorization is enabled.
133+
- `devApiKey` - The API key used to authorize the client in the development environment.
134+
- `apiKeys` - A list of API keys that can be used to authorize the client.
135+
136+
137+
## Settings
138+
139+
Use the following settings in the `appsettings.json` file according to your needs
140+
141+
```json
142+
"authorization": {
143+
"enabled": true,
144+
"devApiKey": "dev_api_key",
145+
"apiKeys": [
146+
"prod_api_key_1",
147+
"prod_api_key_2"
148+
]
149+
}
150+
```
151+
152+
### Default settings
153+
154+
Default settings for some variable has bee overwritten with the following configuration.
155+
156+
```json
157+
"authorization": {
158+
"enabled": true,
159+
"devApiKey": "abc_123",
160+
"apiKeys": [
161+
"prod_api_key_1",
162+
"prod_api_key_2"
163+
]
164+
}
165+
```

static/images/gnx-ci-cd-pipeline.svg

Lines changed: 4 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)