Skip to content

Commit e955522

Browse files
authored
docs: update backend logging documentation and rename to LFX Projects (#32)
* docs: update backend logging documentation and rename to LFX Projects - Document dual logger architecture (serverLogger + httpLogger) - Add LOG_LEVEL environment variable configuration - Update security redaction paths for both loggers - Add comprehensive error handling integration examples - Document server startup logging with environment details - Add logger export and reusability patterns - Update production considerations with conditional stack traces - Enhance formatting configuration documentation - Add clear guidance on when to use each logger type - Rename application from "LFX Projects Self-Service" to "LFX Projects" - Update all references and branding to reflect new name - Update authentication documentation with new application name Generated with [Claude Code](https://claude.ai/code) Signed-off-by: Asitha de Silva <asithade@gmail.com> * fix: address pr comments and fix lfx v2 service url Signed-off-by: Asitha de Silva <asithade@gmail.com> --------- Signed-off-by: Asitha de Silva <asithade@gmail.com>
1 parent 516dfc9 commit e955522

File tree

13 files changed

+293
-64
lines changed

13 files changed

+293
-64
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"cSpell.words": [
33
"animateonscroll",
4+
"AUTHELIA",
45
"autorestart",
56
"cloudops",
67
"confirmdialog",

apps/lfx-pcc/.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Environment Configuration
22
ENV=development
33
PCC_BASE_URL=http://localhost:4200
4+
LOG_LEVEL=info
45

56
# Auth0 Authentication Configuration
67
# Get these values from your Auth0 dashboard
@@ -25,4 +26,5 @@ SUPABASE_STORAGE_BUCKET=your-supabase-bucket-name
2526
TEST_USERNAME=your-test-username
2627
TEST_PASSWORD=your-test-password
2728

29+
# LOCAL ONLY FOR AUTHELIA
2830
NODE_TLS_REJECT_UNAUTHORIZED=0

apps/lfx-pcc/e2e/homepage-robust.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright The Linux Foundation and each contributor to LFX.
22
// SPDX-License-Identifier: MIT
33

4-
import { test, expect } from '@playwright/test';
4+
import { expect, test } from '@playwright/test';
55

66
test.describe('Homepage - Robust Tests', () => {
77
test.beforeEach(async ({ page }) => {
@@ -13,7 +13,7 @@ test.describe('Homepage - Robust Tests', () => {
1313

1414
test.describe('Page Structure and Components', () => {
1515
test('should have correct page structure with main sections', async ({ page }) => {
16-
await expect(page).toHaveTitle('LFX Projects Self-Service');
16+
await expect(page).toHaveTitle('LFX Projects');
1717
await expect(page).toHaveURL('/');
1818

1919
// Check main homepage component is present
@@ -320,7 +320,7 @@ test.describe('Homepage - Robust Tests', () => {
320320
if (isMobile) {
321321
// Search in header should be hidden on mobile
322322
await expect(page.getByPlaceholder('Search projects...')).toBeHidden();
323-
await expect(page.getByText('Projects Self-Service')).toBeHidden();
323+
await expect(page.getByText('Projects', { exact: true })).toBeHidden();
324324
}
325325

326326
// Logo should still be visible
@@ -336,7 +336,7 @@ test.describe('Homepage - Robust Tests', () => {
336336

337337
// Header elements should be visible on tablet (medium and up)
338338
await expect(page.getByPlaceholder('Search projects...')).toBeVisible();
339-
await expect(page.getByText('Projects Self-Service')).toBeVisible();
339+
await expect(page.getByText('Projects', { exact: true })).toBeVisible();
340340
await expect(page.getByAltText('LFX Logo')).toBeVisible();
341341
});
342342

@@ -349,7 +349,7 @@ test.describe('Homepage - Robust Tests', () => {
349349

350350
// Header elements should be visible on desktop
351351
await expect(page.getByPlaceholder('Search projects...')).toBeVisible();
352-
await expect(page.getByText('Projects Self-Service')).toBeVisible();
352+
await expect(page.getByText('Projects', { exact: true })).toBeVisible();
353353
await expect(page.getByAltText('LFX Logo')).toBeVisible();
354354
});
355355
});

apps/lfx-pcc/e2e/homepage.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ test.describe('Homepage', () => {
2828
// Check for logo and brand
2929
await expect(page.getByRole('button', { name: 'Go to home page' })).toBeVisible();
3030
await expect(page.getByAltText('LFX Logo')).toBeVisible();
31-
await expect(page.getByText('Projects Self-Service')).toBeVisible();
31+
await expect(page.getByText('Projects', { exact: true })).toBeVisible();
3232

3333
// Header search should be visible on desktop (md and larger)
3434
await expect(page.getByPlaceholder('Search projects...')).toBeVisible();
@@ -47,7 +47,7 @@ test.describe('Homepage', () => {
4747

4848
// Header search and brand text should be hidden on mobile
4949
await expect(page.getByPlaceholder('Search projects...')).toBeHidden();
50-
await expect(page.getByText('Projects Self-Service')).toBeHidden();
50+
await expect(page.getByText('Projects', { exact: true })).toBeHidden();
5151

5252
// Mobile search toggle button should be visible
5353
await expect(page.getByTestId('mobile-search-toggle')).toBeVisible();
@@ -205,7 +205,7 @@ test.describe('Homepage', () => {
205205

206206
// On mobile, header search and brand text should be hidden
207207
await expect(page.getByPlaceholder('Search projects...')).toBeHidden();
208-
await expect(page.getByText('Projects Self-Service')).toBeHidden();
208+
await expect(page.getByText('Projects', { exact: true })).toBeHidden();
209209

210210
// Logo should still be visible
211211
await expect(page.getByAltText('LFX Logo')).toBeVisible();

apps/lfx-pcc/e2e/project-dashboard-robust.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright The Linux Foundation and each contributor to LFX.
22
// SPDX-License-Identifier: MIT
33

4-
import { test, expect } from '@playwright/test';
4+
import { expect, test } from '@playwright/test';
55

66
test.describe('Project Dashboard - Robust Tests', () => {
77
test.beforeEach(async ({ page }) => {
@@ -19,7 +19,7 @@ test.describe('Project Dashboard - Robust Tests', () => {
1919

2020
test.describe('Page Structure and Components', () => {
2121
test('should have correct page structure with main content', async ({ page }) => {
22-
await expect(page).toHaveTitle('LFX Projects Self-Service');
22+
await expect(page).toHaveTitle('LFX Projects');
2323
await expect(page).toHaveURL(/\/project\/\w+$/);
2424

2525
// Check main project component is present
@@ -249,8 +249,8 @@ test.describe('Project Dashboard - Robust Tests', () => {
249249
// Search bar should be hidden on mobile (responsive design)
250250
await expect(page.getByPlaceholder('Search projects...')).toBeHidden();
251251

252-
// Projects Self-Service text should be hidden on mobile
253-
await expect(page.getByText('Projects Self-Service')).toBeHidden();
252+
// Projects text should be hidden on mobile
253+
await expect(page.getByText('Projects', { exact: true })).toBeHidden();
254254

255255
// Logo should still be visible
256256
await expect(page.getByAltText('LFX Logo')).toBeVisible();
@@ -267,7 +267,7 @@ test.describe('Project Dashboard - Robust Tests', () => {
267267

268268
// Header elements should be visible on tablet (medium and up)
269269
await expect(page.getByPlaceholder('Search projects...')).toBeVisible();
270-
await expect(page.getByText('Projects Self-Service')).toBeVisible();
270+
await expect(page.getByText('Projects', { exact: true })).toBeVisible();
271271
await expect(page.getByAltText('LFX Logo')).toBeVisible();
272272
});
273273
});

apps/lfx-pcc/e2e/project-dashboard.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright The Linux Foundation and each contributor to LFX.
22
// SPDX-License-Identifier: MIT
33

4-
import { test, expect } from '@playwright/test';
4+
import { expect, test } from '@playwright/test';
55

66
test.describe('Project Dashboard', () => {
77
test.beforeEach(async ({ page }) => {
@@ -19,7 +19,7 @@ test.describe('Project Dashboard', () => {
1919

2020
test.describe('Navigation and Layout', () => {
2121
test('should display correct page title and URL', async ({ page }) => {
22-
await expect(page).toHaveTitle('LFX Projects Self-Service');
22+
await expect(page).toHaveTitle('LFX Projects');
2323
await expect(page).toHaveURL(/\/project\/\w+$/);
2424
});
2525

@@ -34,13 +34,13 @@ test.describe('Project Dashboard', () => {
3434
if (isMobile) {
3535
// On mobile: search and brand text should be hidden
3636
await expect(page.getByPlaceholder('Search projects...')).toBeHidden();
37-
await expect(page.getByText('Projects Self-Service')).toBeHidden();
37+
await expect(page.getByText('Projects', { exact: true })).toBeHidden();
3838
// Mobile search toggle should be visible
3939
await expect(page.getByTestId('mobile-search-toggle')).toBeVisible();
4040
} else {
4141
// On desktop: search and brand text should be visible
4242
await expect(page.getByPlaceholder('Search projects...')).toBeVisible();
43-
await expect(page.getByText('Projects Self-Service')).toBeVisible();
43+
await expect(page.getByText('Projects', { exact: true })).toBeVisible();
4444
// Mobile search toggle should be hidden
4545
await expect(page.getByTestId('mobile-search-toggle')).toBeHidden();
4646
}
@@ -278,8 +278,8 @@ test.describe('Project Dashboard', () => {
278278
// Search bar should be hidden on mobile (responsive design)
279279
await expect(page.getByPlaceholder('Search projects...')).toBeHidden();
280280

281-
// Projects Self-Service text should also be hidden on mobile
282-
await expect(page.getByText('Projects Self-Service')).toBeHidden();
281+
// Projects text should also be hidden on mobile
282+
await expect(page.getByText('Projects', { exact: true })).toBeHidden();
283283

284284
// Mobile search toggle should be visible
285285
await expect(page.getByTestId('mobile-search-toggle')).toBeVisible();

apps/lfx-pcc/src/app/shared/components/header/header.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
<div class="border-r border-solid border-gray-200 pr-2">
1010
<img src="/images/lfx-logo.svg" alt="LFX Logo" class="w-auto h-5" />
1111
</div>
12-
<span class="text-xl font-display text-gray-900 hidden md:block">Projects Self-Service</span>
12+
<span class="text-xl font-display text-gray-900 hidden md:block">Projects</span>
1313
</button>
1414
</ng-template>
1515

1616
<ng-template #end>
1717
<div class="flex items-center gap-4">
18-
<lfx-tools kit="736c27f195" product="projects-self-service"></lfx-tools>
18+
<lfx-tools kit="736c27f195" product="projects"></lfx-tools>
1919
<div class="flex items-center gap-6">
2020
<!-- Mobile Search Toggle -->
2121
<button

apps/lfx-pcc/src/app/shared/components/header/header.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SPDX-License-Identifier: MIT
33

44
import { CommonModule } from '@angular/common';
5-
import { Component, CUSTOM_ELEMENTS_SCHEMA, inject, signal, WritableSignal, viewChild, ElementRef } from '@angular/core';
5+
import { Component, CUSTOM_ELEMENTS_SCHEMA, ElementRef, inject, signal, viewChild, WritableSignal } from '@angular/core';
66
import { FormControl, ReactiveFormsModule } from '@angular/forms';
77
import { Router, RouterModule } from '@angular/router';
88
import { AvatarComponent } from '@components/avatar/avatar.component';
@@ -42,7 +42,7 @@ export class HeaderComponent {
4242
{
4343
label: 'Developer Settings',
4444
icon: 'fa-light fa-cog',
45-
url: environment.urls.profile + '/developer-settings',
45+
url: environment.urls.profile + 'developer-settings',
4646
target: '_blank',
4747
},
4848
{

apps/lfx-pcc/src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<html lang="en">
66
<head>
77
<meta charset="utf-8" />
8-
<title>LFX Projects Self-Service</title>
8+
<title>LFX Projects</title>
99
<base href="/" />
1010
<meta name="viewport" content="width=device-width, initial-scale=1" />
1111
<link rel="icon" type="image/x-icon" href="favicon.ico" />

apps/lfx-pcc/src/server/server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const app = express();
4343
const serverLogger = pino({
4444
level: process.env['LOG_LEVEL'] || 'info',
4545
redact: {
46-
paths: ['access_token', 'refresh_token', 'authorization', 'cookie'],
46+
paths: ['access_token', 'refresh_token', 'authorization', 'cookie', 'req.headers.authorization', 'req.headers.cookie', 'res.headers["set-cookie"]'],
4747
remove: true,
4848
},
4949
formatters: {
@@ -92,10 +92,10 @@ const httpLogger = pinoHttp({
9292
},
9393
},
9494
redact: {
95-
paths: ['req.headers.authorization', 'req.headers.cookie', 'res.headers["set-cookie"]'],
95+
paths: ['access_token', 'refresh_token', 'authorization', 'cookie', 'req.headers.authorization', 'req.headers.cookie', 'res.headers["set-cookie"]'],
9696
remove: true,
9797
},
98-
level: 'info',
98+
level: process.env['LOG_LEVEL'] || 'info',
9999
formatters: {
100100
level: (label) => {
101101
return { level: label.toUpperCase() };

0 commit comments

Comments
 (0)