Skip to content

feat(authentication): ROSS-177: refactored, cleaned, improved auth config related code, added MFA support#65

Merged
imdeepmind merged 12 commits into
developfrom
ROSS-177
Jul 24, 2026
Merged

feat(authentication): ROSS-177: refactored, cleaned, improved auth config related code, added MFA support#65
imdeepmind merged 12 commits into
developfrom
ROSS-177

Conversation

@imdeepmind

Copy link
Copy Markdown
Owner

No description provided.

Replace flat auth config (auth.enableAuth, auth.authEngine,
auth.authModel, auth.apiKey, auth.jwtSecret) with a provider-based
authentication structure:

- authentication.enabled (boolean)
- authentication.provider.type ('up-auth' | 'api-key')
- authentication.provider.config.userModel (model, idField,
  usernameField, passwordField)
- authentication.provider.config.jwtSecret
- authentication.provider.config.key

All config consumers, validators, route guards, security schemas,
and tests updated accordingly.
…l string

SEC-5: resolveEnvVars silently returned the literal 'env:VARNAME'
string when the environment variable was not set. For sensitive
fields like jwtSecret or apiKey this would use a trivially guessable
credential.

Now throws with a clear error message at config load time,
before the server starts. Includes guard for empty env var name.
…del only

BUG-2: UserModel field existence (idField, usernameField,
passwordField) was validated against ALL models, not just the
model referenced by userModel.model. A config pointing at model
'users' with idField 'user_id' would pass because 'user_id'
exists in the 'posts' model.

Now finds the target model via config.models.find() once and
scopes field checks to its fields only.
@imdeepmind
imdeepmind merged commit 1b09368 into develop Jul 24, 2026
4 checks passed
@imdeepmind
imdeepmind deleted the ROSS-177 branch July 24, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant