Skip to content

Commit 9a31f9f

Browse files
committed
Status
1 parent ea57872 commit 9a31f9f

5 files changed

Lines changed: 148 additions & 39 deletions

File tree

apps/api-manager/src/routes/about/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</li>
4242
<li>
4343
<a href="/status" class="text-primary-600 dark:text-primary-400 underline hover:text-primary-800 dark:hover:text-primary-300" data-testid="link-status">
44-
System Status
44+
Status
4545
</a>
4646
— check the health of the API
4747
</li>

apps/portal/src/routes/(protected)/obp-consent-request-redirect/+page.server.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,18 @@ export async function load(event: RequestEvent) {
2828
returnUrl.searchParams.set('bank_id', bankId);
2929
}
3030

31-
// Pass the authenticated user's ID so OBP-OIDC can generate the auth code for this user
32-
const userId = event.locals.session.data.user?.user_id;
33-
if (userId) {
34-
returnUrl.searchParams.set('user_id', userId);
31+
// Identify the authenticated user so OBP-OIDC can generate the auth code for them.
32+
// username + provider let OBP-OIDC resolve the user via the OBP-API REST endpoint
33+
// (GET /users/provider/PROVIDER/username/USERNAME); user_id is kept for reference.
34+
const sessionUser = event.locals.session.data.user;
35+
if (sessionUser?.user_id) {
36+
returnUrl.searchParams.set('user_id', sessionUser.user_id);
37+
}
38+
if (sessionUser?.username) {
39+
returnUrl.searchParams.set('username', sessionUser.username);
40+
}
41+
if (sessionUser?.provider) {
42+
returnUrl.searchParams.set('provider', sessionUser.provider);
3543
}
3644

3745
// Clean up the consent flow data from session

apps/portal/src/routes/about/+page.svelte

Lines changed: 58 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,42 +20,9 @@
2020
2121
The Open Bank Project (OBP) Portal is a comprehensive developer portal that provides access to banking APIs and tools for building financial applications. It serves as the gateway for developers, fintech companies, and financial institutions to explore, integrate, and leverage open banking capabilities.
2222
23-
## Key Features
24-
25-
- API Explorer for testing and discovering banking APIs
26-
- Consumer management and API key generation
27-
- User account management and authentication
28-
- Comprehensive documentation and guides
29-
- OAuth2 compliance and security features
30-
- Developer tools and resources
31-
3223
## About Open Bank Project
3324
34-
The Open Bank Project is an open source API and App store for banks that empowers financial institutions to securely and rapidly enhance their digital offerings using an ecosystem of 3rd party applications and services. The project provides a RESTful API that allows developers to build financial applications on top of banking data.
35-
36-
## Technology
37-
38-
This portal is built with modern web technologies including SvelteKit, TypeScript, and Skeleton UI. It follows best practices for security, accessibility, and user experience.
39-
40-
## Get Involved
41-
42-
The Open Bank Project is an open source initiative. You can contribute to the project, report issues, or explore the codebase on our [GitHub repository](https://github.com/OpenBankProject).
43-
44-
## License
45-
46-
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
47-
48-
## Contact & Support
49-
50-
For questions, support, or more information about the Open Bank Project, please visit:
51-
52-
- [Official Website](https://www.openbankproject.com)
53-
- [GitHub Organization](https://github.com/OpenBankProject)
54-
- [Open Bank Project Chat](${env.PUBLIC_OBP_CHAT_URL || 'https://chat.openbankproject.com'})
55-
56-
---
57-
58-
© TESOBE 2011-${Math.max(new Date().getFullYear(), 2026)}. All rights reserved.`;
25+
The Open Bank Project is an open source API and App store for banks that empowers financial institutions to securely and rapidly enhance their digital offerings using an ecosystem of 3rd party applications and services. The project provides a RESTful API that allows developers to build financial applications on top of banking data.`;
5926
6027
onMount(async () => {
6128
// Dynamically import markdown-it to avoid SSR issues
@@ -91,6 +58,63 @@ For questions, support, or more information about the Open Bank Project, please
9158
</div>
9259
{/if}
9360

61+
<!-- Rendered outside the markdown so it survives PUBLIC_ABOUT_TEXT overrides -->
62+
<h2 class="h3 mt-8" data-testid="useful-links-title">Useful Links</h2>
63+
<ul class="mt-4 list-disc space-y-2 pl-5">
64+
<li>
65+
<a
66+
href="/status"
67+
class="text-primary-600 dark:text-primary-400 underline hover:text-primary-800 dark:hover:text-primary-300"
68+
data-testid="link-status"
69+
>
70+
Status
71+
</a>
72+
— check the health of this portal and its services
73+
</li>
74+
<li>
75+
<a
76+
href="https://www.openbankproject.com"
77+
target="_blank"
78+
rel="noopener noreferrer"
79+
class="text-primary-600 dark:text-primary-400 underline hover:text-primary-800 dark:hover:text-primary-300"
80+
data-testid="link-website"
81+
>
82+
Official Website
83+
</a>
84+
</li>
85+
<li>
86+
<a
87+
href="https://github.com/OpenBankProject"
88+
target="_blank"
89+
rel="noopener noreferrer"
90+
class="text-primary-600 dark:text-primary-400 underline hover:text-primary-800 dark:hover:text-primary-300"
91+
data-testid="link-github"
92+
>
93+
GitHub Organization
94+
</a>
95+
</li>
96+
<li>
97+
<a
98+
href={env.PUBLIC_OBP_CHAT_URL || 'https://chat.openbankproject.com'}
99+
target="_blank"
100+
rel="noopener noreferrer"
101+
class="text-primary-600 dark:text-primary-400 underline hover:text-primary-800 dark:hover:text-primary-300"
102+
data-testid="link-chat"
103+
>
104+
Open Bank Project Chat
105+
</a>
106+
</li>
107+
</ul>
108+
109+
<h2 class="h3 mt-8" data-testid="license-title">License</h2>
110+
<p class="mt-4">
111+
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
112+
</p>
113+
114+
<p class="mt-8 border-t border-surface-200-800 pt-6 text-sm text-surface-600-400">
115+
© TESOBE 2011-{Math.max(new Date().getFullYear(), 2026)}. All rights reserved.
116+
</p>
117+
94118
<!-- Version Information Footer -->
95119
<div class="mt-12 border-t border-surface-200-800 pt-8">
96120
<div class="text-sm text-surface-600-400">

packages/shared/src/lib/components/SystemStatusPage.svelte

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@
143143
return 'bg-green-500';
144144
case 'unhealthy':
145145
return 'bg-red-500';
146+
case 'partial':
147+
return 'bg-orange-500';
146148
case 'degraded':
147149
return 'bg-yellow-500';
148150
case 'unknown':
@@ -158,6 +160,8 @@
158160
return 'text-green-600 dark:text-green-400';
159161
case 'unhealthy':
160162
return 'text-red-600 dark:text-red-400';
163+
case 'partial':
164+
return 'text-orange-600 dark:text-orange-400';
161165
case 'degraded':
162166
return 'text-yellow-600 dark:text-yellow-400';
163167
case 'unknown':
@@ -173,6 +177,7 @@
173177
return '';
174178
case 'unhealthy':
175179
return '';
180+
case 'partial':
176181
case 'degraded':
177182
return '';
178183
case 'unknown':

packages/shared/src/lib/health-check/summarize.test.ts

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,78 @@ describe('summarizeHealth', () => {
4141
expect(result.summary.unhealthy).toBe(1);
4242
});
4343

44+
it('reports partial when at least one OAuth2 provider is healthy and another is not', () => {
45+
const result = summarizeHealth(
46+
{
47+
'OBP API': snapshot({ service: 'OBP API' }),
48+
'OAuth2: obp-oidc': snapshot({ service: 'OAuth2: obp-oidc' }),
49+
'OAuth2: google': snapshot({
50+
service: 'OAuth2: google',
51+
status: 'unhealthy',
52+
error: 'GOOGLE_OAUTH_CLIENT_ID and GOOGLE_OAUTH_CLIENT_SECRET must be set'
53+
})
54+
},
55+
NOW
56+
);
57+
expect(result.overallStatus).toBe('partial');
58+
expect(result.summary.unhealthy).toBe(1);
59+
});
60+
61+
it('reports unhealthy when no OAuth2 provider is healthy', () => {
62+
const result = summarizeHealth(
63+
{
64+
'OBP API': snapshot({ service: 'OBP API' }),
65+
'OAuth2: obp-oidc': snapshot({
66+
service: 'OAuth2: obp-oidc',
67+
status: 'unhealthy',
68+
error: 'fetch failed'
69+
}),
70+
'OAuth2: google': snapshot({
71+
service: 'OAuth2: google',
72+
status: 'unhealthy',
73+
error: 'missing credentials'
74+
})
75+
},
76+
NOW
77+
);
78+
expect(result.overallStatus).toBe('unhealthy');
79+
});
80+
81+
it('reports unhealthy when a core service is down even if OAuth2 is only partial', () => {
82+
const result = summarizeHealth(
83+
{
84+
Redis: snapshot({ service: 'Redis', status: 'unhealthy', error: 'ECONNREFUSED' }),
85+
'OAuth2: obp-oidc': snapshot({ service: 'OAuth2: obp-oidc' }),
86+
'OAuth2: google': snapshot({
87+
service: 'OAuth2: google',
88+
status: 'unhealthy',
89+
error: 'missing credentials'
90+
})
91+
},
92+
NOW
93+
);
94+
expect(result.overallStatus).toBe('unhealthy');
95+
});
96+
97+
it('does not report partial when a stale OAuth2 provider is the only healthy-looking one', () => {
98+
const fiveMinutesAgo = new Date(NOW.getTime() - 5 * 60_000).toISOString();
99+
const result = summarizeHealth(
100+
{
101+
'OAuth2: obp-oidc': snapshot({
102+
service: 'OAuth2: obp-oidc',
103+
lastChecked: fiveMinutesAgo
104+
}),
105+
'OAuth2: google': snapshot({
106+
service: 'OAuth2: google',
107+
status: 'unhealthy',
108+
error: 'missing credentials'
109+
})
110+
},
111+
NOW
112+
);
113+
expect(result.overallStatus).toBe('unhealthy');
114+
});
115+
44116
it('reports unknown when a service has not yet been checked', () => {
45117
const result = summarizeHealth({ a: snapshot(), b: snapshot({ status: 'unknown' }) }, NOW);
46118
expect(result.overallStatus).toBe('unknown');

0 commit comments

Comments
 (0)