@rineex/auth-core 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -3
- package/Architecture.md +0 -257
- package/CHANGELOG.md +0 -62
- package/Definition.md +0 -1490
- package/Develop.md +0 -0
- package/RULES.md +0 -1470
- package/eslint.config.mjs +0 -59
- package/src/application/mfa/events/challenge-issue-observability.event.ts +0 -18
- package/src/application/mfa/events/session-started-observability.event.ts +0 -18
- package/src/application/mfa/events/verification-failed-observability.event.ts +0 -14
- package/src/application/mfa/events/verification-succeeded-observibility.event.ts +0 -12
- package/src/application/mfa/issue-mfa-challenge.application-service.ts +0 -75
- package/src/application/mfa/start-mfa-session.application-service.ts +0 -90
- package/src/application/mfa/verify-mfa.application-service.ts +0 -61
- package/src/application/services/auth-orchestrator.service.ts +0 -77
- package/src/application/services/oauth-authorize.service.ts +0 -12
- package/src/domain/identity/aggregates/authentication-attempt.aggregate.ts +0 -136
- package/src/domain/identity/aggregates/index.ts +0 -1
- package/src/domain/identity/entities/identity.entity.ts +0 -126
- package/src/domain/identity/entities/index.ts +0 -1
- package/src/domain/identity/events/authentication-failed.event.ts +0 -24
- package/src/domain/identity/events/authentication-started.event.ts +0 -29
- package/src/domain/identity/events/authentication-succeeded.event.ts +0 -24
- package/src/domain/identity/events/index.ts +0 -3
- package/src/domain/identity/index.ts +0 -4
- package/src/domain/identity/value-objects/__tests__/auth-attempt-id.vo.spec.ts +0 -42
- package/src/domain/identity/value-objects/__tests__/auth-factor.vo.spec.ts +0 -39
- package/src/domain/identity/value-objects/__tests__/auth-method.vo.spec.ts +0 -0
- package/src/domain/identity/value-objects/auth-attempt-id.vo.ts +0 -23
- package/src/domain/identity/value-objects/auth-factor.vo.ts +0 -17
- package/src/domain/identity/value-objects/auth-method.vo.ts +0 -34
- package/src/domain/identity/value-objects/auth-policy.vo.ts +0 -19
- package/src/domain/identity/value-objects/auth-status.vo.ts +0 -38
- package/src/domain/identity/value-objects/identity-id.vo.ts +0 -26
- package/src/domain/identity/value-objects/identity-provider.vo.ts +0 -13
- package/src/domain/identity/value-objects/index.ts +0 -8
- package/src/domain/identity/value-objects/risk-signal.vo.ts +0 -17
- package/src/domain/index.ts +0 -5
- package/src/domain/mfa/aggregates/mfa-session.aggregate.ts +0 -84
- package/src/domain/mfa/entities/mfa-challenge.entity.ts +0 -70
- package/src/domain/mfa/types/mfa-challenge-registry.ts +0 -21
- package/src/domain/mfa/value-objects/mfa-challenge-id.vo.ts +0 -19
- package/src/domain/mfa/value-objects/mfa-challenge-status.vo.ts +0 -31
- package/src/domain/mfa/value-objects/mfa-session-id.vo.ts +0 -19
- package/src/domain/mfa/violations/mfa-active-challenge-exists.violation.ts +0 -10
- package/src/domain/mfa/violations/mfa-already-verified.violation.ts +0 -10
- package/src/domain/mfa/violations/mfa-attempts-exceeded.violation.ts +0 -17
- package/src/domain/mfa/violations/mfa-expired.violation.ts +0 -10
- package/src/domain/oauth/aggregates/oauth-authorization.aggregate.ts +0 -106
- package/src/domain/oauth/aggregates/oauth-authorize.service.ts +0 -0
- package/src/domain/oauth/entities/oauth-authorization.entity.ts +0 -50
- package/src/domain/oauth/value-objects/authorization-code-id.vo.ts +0 -9
- package/src/domain/oauth/value-objects/authorization-code.vo.ts +0 -18
- package/src/domain/oauth/value-objects/client-id.vo.ts +0 -9
- package/src/domain/oauth/value-objects/code-challenge-method.vo.ts +0 -15
- package/src/domain/oauth/value-objects/code-challenge.vo.ts +0 -24
- package/src/domain/oauth/value-objects/oauth-authorization-id.vo.ts +0 -19
- package/src/domain/oauth/value-objects/oauth-provider.vo.ts +0 -15
- package/src/domain/oauth/value-objects/pkce.vo.ts +0 -29
- package/src/domain/oauth/value-objects/redirect-uri.vo.ts +0 -19
- package/src/domain/oauth/value-objects/scope-set.vo.ts +0 -37
- package/src/domain/oauth/violations/authorization-already-used.violation.ts +0 -10
- package/src/domain/oauth/violations/authorization-expired.violation.ts +0 -10
- package/src/domain/oauth/violations/consent-required.violation.ts +0 -10
- package/src/domain/oauth/violations/invalid-authorization-code.violation.ts +0 -12
- package/src/domain/oauth/violations/invalid-oauth-provider.violation.ts +0 -13
- package/src/domain/oauth/violations/invalid-pkce.violation.ts +0 -12
- package/src/domain/oauth/violations/invalid-redirect-uri.violation.ts +0 -10
- package/src/domain/policy/contracts/auth-policy-context.ts +0 -27
- package/src/domain/policy/contracts/auth-policy-decision.ts +0 -7
- package/src/domain/policy/contracts/auth-policy.ts +0 -17
- package/src/domain/policy/contracts/index.ts +0 -3
- package/src/domain/policy/engine/auth-policy-engine.ts +0 -41
- package/src/domain/policy/index.ts +0 -2
- package/src/domain/session/entities/session.entity.ts +0 -82
- package/src/domain/session/value-objects/session-id.vo.ts +0 -10
- package/src/domain/token/aggregates/token.aggregate.ts +0 -34
- package/src/domain/token/value-objects/auth-token.vo.ts +0 -29
- package/src/domain/token/value-objects/session-token.vo.ts +0 -14
- package/src/domain/violations/auth-domain.violation.ts +0 -9
- package/src/domain/violations/invalid-auth-token.violation.ts +0 -13
- package/src/domain/violations/invalid-scope.violation.ts +0 -10
- package/src/domain/violations/invalid-session.violation.ts +0 -13
- package/src/index.ts +0 -3
- package/src/ports/inbound/auth-method.port.ts +0 -18
- package/src/ports/inbound/index.ts +0 -2
- package/src/ports/inbound/start-auth.command.ts +0 -28
- package/src/ports/index.ts +0 -2
- package/src/ports/log/log.port.ts +0 -25
- package/src/ports/mfa/mfa-clock.port.ts +0 -11
- package/src/ports/mfa/mfa-session-id-generator.port.ts +0 -15
- package/src/ports/mfa/mfa-session-repository.port.ts +0 -31
- package/src/ports/observability/observability-event.port.ts +0 -16
- package/src/ports/outbound/authentication-attempt.repository.port.ts +0 -11
- package/src/ports/outbound/domain-event-publisher.port.ts +0 -13
- package/src/ports/outbound/index.ts +0 -2
- package/src/ports/outbound/session.repository.port.ts +0 -9
- package/src/ports/repositories/oauth-authorization.repository.ts +0 -21
- package/src/ports/repositories/token.repository.ts +0 -11
- package/src/types/auth-context.type.ts +0 -11
- package/src/types/auth-factor.type.ts +0 -10
- package/src/types/auth-method.type.ts +0 -20
- package/src/types/auth-policy.type.ts +0 -16
- package/src/types/identity-provider.type.ts +0 -8
- package/src/types/index.ts +0 -6
- package/src/types/observability-event.ts +0 -33
- package/src/types/risk-signal.type.ts +0 -11
- package/src/utils/default-if-blank.util.ts +0 -46
- package/tsconfig.build.json +0 -6
- package/tsconfig.json +0 -30
- package/tsup.config.ts +0 -13
- package/vitest.config.ts +0 -12
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import isEmpty from 'lodash.isempty';
|
|
2
|
-
import isNil from 'lodash.isnil';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Returns a default value if the input string is nil or empty.
|
|
6
|
-
*
|
|
7
|
-
* @param value - The input string to check.
|
|
8
|
-
* @param defaultValue - The default string to return if input is nil or empty.
|
|
9
|
-
* @returns The input string if non-empty, otherwise the default value.
|
|
10
|
-
*/
|
|
11
|
-
export function defaultIfBlank<T extends string = string>(
|
|
12
|
-
value: T,
|
|
13
|
-
defaultValue: T,
|
|
14
|
-
): T {
|
|
15
|
-
if (isNil(value) || isEmpty(value)) {
|
|
16
|
-
return defaultValue;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return value;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Returns null if the input string is nil or empty, otherwise returns the input.
|
|
24
|
-
*
|
|
25
|
-
* @param value - The input string to check.
|
|
26
|
-
* @returns The input string if non-empty, otherwise null.
|
|
27
|
-
*/
|
|
28
|
-
export function defaultIfNilOrEmpty<T extends string = string>(
|
|
29
|
-
value: T | null | undefined,
|
|
30
|
-
): T | null {
|
|
31
|
-
if (isNil(value) || isEmpty(value)) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return value;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function defaultIfUndefinedOrEmpty<T extends string = string>(
|
|
39
|
-
value: T | undefined,
|
|
40
|
-
): T | undefined {
|
|
41
|
-
if (isNil(value) || isEmpty(value)) {
|
|
42
|
-
return undefined;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return value;
|
|
46
|
-
}
|
package/tsconfig.build.json
DELETED
package/tsconfig.json
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "commonjs",
|
|
4
|
-
"declaration": true,
|
|
5
|
-
"noUnusedLocals": false,
|
|
6
|
-
"strictNullChecks": true,
|
|
7
|
-
"importHelpers": true,
|
|
8
|
-
"removeComments": false,
|
|
9
|
-
"noLib": false,
|
|
10
|
-
"emitDecoratorMetadata": true,
|
|
11
|
-
"esModuleInterop": true,
|
|
12
|
-
"experimentalDecorators": true,
|
|
13
|
-
"noImplicitThis": true,
|
|
14
|
-
"target": "es6",
|
|
15
|
-
"moduleResolution": "node",
|
|
16
|
-
"skipLibCheck": true,
|
|
17
|
-
"sourceMap": false,
|
|
18
|
-
"outDir": "./dist",
|
|
19
|
-
"noImplicitAny": true,
|
|
20
|
-
"rootDir": ".",
|
|
21
|
-
"strictPropertyInitialization": true,
|
|
22
|
-
"paths": {
|
|
23
|
-
"@/*": ["./src/*"]
|
|
24
|
-
},
|
|
25
|
-
"lib": ["es7", "ES2021.WeakRef", "ES2022"],
|
|
26
|
-
"types": ["node"]
|
|
27
|
-
},
|
|
28
|
-
"include": ["src/**/*", "tsup.config.ts", "vitest.config.ts"],
|
|
29
|
-
"exclude": ["node_modules"]
|
|
30
|
-
}
|
package/tsup.config.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'tsup';
|
|
2
|
-
|
|
3
|
-
export default defineConfig(() => ({
|
|
4
|
-
// eslint-disable-next-line n/no-process-env
|
|
5
|
-
minify: process.env.CI === 'true',
|
|
6
|
-
tsconfig: 'tsconfig.build.json',
|
|
7
|
-
entry: ['src/index.ts'],
|
|
8
|
-
format: ['cjs', 'esm'],
|
|
9
|
-
splitting: false,
|
|
10
|
-
sourcemap: true,
|
|
11
|
-
clean: true,
|
|
12
|
-
dts: true,
|
|
13
|
-
}));
|
package/vitest.config.ts
DELETED