feat: authentication (OIDC) integration, package.json bump #6

Merged
bivashy merged 4 commits from feat/auth-integration into sprint/smooth-brazil 2026-09-25 12:12:03 +00:00
Owner

Description

  • OIDC integration
  • package.json versions bump
### Description - OIDC integration - `package.json` versions bump
Author
Owner

Endpoints with authentication:
openapi-ts generated sdk.gen.ts:

/**
 * Me
 */
export const getApiMe = <TComposable extends Composable = '$fetch', DefaultT extends GetApiMeResponse = GetApiMeResponse>(options: Options<TComposable, GetApiMeData, GetApiMeResponse, DefaultT>): RequestResult<TComposable, GetApiMeResponse | DefaultT, DefaultT> => (options.client ?? client).get<TComposable, GetApiMeResponse | DefaultT, unknown, DefaultT>({
    security: [{ scheme: 'bearer', type: 'http' }],
    url: '/api/me',
    ...options
});

It has security attributes in options, plugins/openapi.ts looks for that field:

const proxied = Array.isArray(options.security) && options.security.length > 0;

And if it has such attribute, we forward to /api/auth-proxy endpoint which will attach accessToken as Authorization: Bearer <access_token>.

So OIDC token is stored on the backend side of Nuxt.
One downside: BFF may be bottleneck in the future if there are too much authenticated resources? I am not sure, i hope Nuxt is scalable, i saw some "workers" concept, so i guess it will scale 😄

Endpoints with authentication: `openapi-ts` generated `sdk.gen.ts`: ```ts /** * Me */ export const getApiMe = <TComposable extends Composable = '$fetch', DefaultT extends GetApiMeResponse = GetApiMeResponse>(options: Options<TComposable, GetApiMeData, GetApiMeResponse, DefaultT>): RequestResult<TComposable, GetApiMeResponse | DefaultT, DefaultT> => (options.client ?? client).get<TComposable, GetApiMeResponse | DefaultT, unknown, DefaultT>({ security: [{ scheme: 'bearer', type: 'http' }], url: '/api/me', ...options }); ``` It has `security` attributes in `options`, `plugins/openapi.ts` looks for that field: https://git.bivashy.dev/anyame/anyame-frontend-vue/src/commit/d1a3244823dc43755e6425689f45f8df5e966d79/app/plugins/openapi.ts#L30 And if it has such attribute, we forward to `/api/auth-proxy` endpoint which will attach `accessToken` as `Authorization: Bearer <access_token>`. So `OIDC` token is stored on the backend side of Nuxt. One downside: BFF may be bottleneck in the future if there are too much authenticated resources? I am not sure, i hope Nuxt is scalable, i saw some "workers" concept, so i guess it will scale 😄
bivashy merged commit 3cea25067b into sprint/smooth-brazil 2026-09-25 12:12:03 +00:00
bivashy deleted branch feat/auth-integration 2026-09-25 12:12:08 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
anyame/anyame-frontend-vue!6
No description provided.