fossology / fossology/FOSSologyUI

Bug : API v2 auth token creation fails due to token request field mismatch

Open
#348 7 comments 0 reactions 1 assignee Claimed by @Shikshak-Kumar View on GitHub
bug
Dominant language
JavaScript
Stars
73
Forks
154
PR merge metrics
No merged PRs in 30d

Description

### Description
Token creation via API v2 fails because the frontend sends snake_case
token request fields, while the backend expects camelCase fields.

### Steps to Reproduce
1. Build FOSSologyUI pointing to API v2:

NEXT_PUBLIC_SERVER_URL=localhost/repo/api/v2

2. Attempt to create a new authentication token via the UI or REST call.
3. Observe token creation failure or missing token metadata.

### Expected Behavior
Token should be created successfully with correct token name, scope,
and expiry.

### Actual Behavior
Token metadata is ignored or token creation fails because the backend
does not recognize the provided request fields.

### Root Cause
The backend `TokenRequest::fromArray()` explicitly expects camelCase
fields (`tokenName`, `tokenScope`, `tokenExpire`), but the frontend
sends snake_case fields (`token_name`, `token_scope`, `token_expire`).

### Environment
- FOSSologyUI version: main branch
- API version: v2
- OS: macOS (Apple Silicon)
- Browser: Chrome

### Additional Context
This issue only affects API v2 authentication token creation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.