Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
0ce896e
Improve and add more SSN related Zod schemas
ahinkka Oct 8, 2026
9fe925b
Use error message variable
adetabs Oct 8, 2026
08fd17a
Rename symbol
adetabs Oct 8, 2026
b4a0304
Fix test
adetabs Oct 8, 2026
b23ce7e
CI: Release @digabi/validation@4.0.0-feature-ssn-schemas-with-input-t…
Oct 8, 2026
5d5d880
Bump dependency
adetabs Oct 8, 2026
f54282e
Add prerelease dependency
adetabs Oct 8, 2026
96ee776
Workaround
adetabs Oct 8, 2026
c9464e4
CI: Release @digabi/user-management@0.14.0-feature-ssn-schemas-with-i…
Oct 8, 2026
02544f0
Revert "Workaround"
adetabs Oct 8, 2026
5799883
Use proper matching mode for prerelease tag
adetabs Oct 8, 2026
4a0e0f5
Clarify error messages
adetabs Oct 9, 2026
d012187
Add additional 20th century separators
adetabs Oct 9, 2026
35d55ae
Remove custom error message on string type requirement
adetabs Oct 12, 2026
ace5cc9
Add two-stage check to ssnSchemaWithAgeChecks, refine error message
adetabs Oct 12, 2026
5478f3a
Test every 20th century separator
adetabs Oct 12, 2026
7eab39b
Separate test cases for person over 100 years old with valid and inva…
adetabs Oct 12, 2026
c3c6f4e
CI: Release @digabi/validation@4.0.1-feature-ssn-schemas-with-input-t…
Oct 12, 2026
4d92c31
Remove custom error message on string type requirement
adetabs Oct 13, 2026
7fa4642
Format
adetabs Oct 13, 2026
759f553
Allow lowercase U in fake YTL SSN, allow more separator characters in…
adetabs Oct 14, 2026
bb7d3cc
Use isFakeYtlSsn to check for fake YTL SSN inside normal validation f…
adetabs Oct 14, 2026
ec2d47a
Add more tests for fake YTL SSNs
adetabs Oct 14, 2026
b59d12d
Rename test group
adetabs Oct 14, 2026
1e0a494
Reorder tests for clarity and coherence
adetabs Oct 14, 2026
292a6e8
CI: Release @digabi/validation@4.1.0-feature-ssn-schemas-with-input-t…
Oct 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/user-management/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@digabi/user-management",
"version": "0.13.0",
"version": "0.14.0-feature-ssn-schemas-with-input-trimming.0",
"author": "Matriculation Examination Board, Finland",
"license": "EUPL-1.2",
"repository": {
Expand All @@ -27,7 +27,7 @@
"access": "public"
},
"dependencies": {
"@digabi/validation": "^3.1.0",
"@digabi/validation": "^4.0.0-feature-ssn-schemas-with-input-trimming.0",
"zod": "^4.4.3"
}
}
14 changes: 7 additions & 7 deletions packages/user-management/src/user-types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import z from 'zod'
import { RoleSchema } from './validations'
import { zodSsn } from '@digabi/validation'
import { ssnSchema } from '@digabi/validation'
import { PermissionGrantSchema } from './permissions'

export type Role = z.infer<typeof RoleSchema>
Expand All @@ -19,8 +19,8 @@ export const PrincipalOrganizationSchema = z.object({
export type Impersonation = z.infer<typeof ImpersonationSchema>
export const ImpersonationSchema = z.object({
id: z.uuid(),
realSsn: zodSsn,
impersonatedSsn: zodSsn.or(z.literal('')),
realSsn: ssnSchema,
impersonatedSsn: ssnSchema.or(z.literal('')),
Comment thread
adetabs marked this conversation as resolved.
explanation: z.string(),
validityStart: z.string(),
validityEnd: z.string(),
Expand All @@ -32,7 +32,7 @@ export const MockUserSchema = z.object({
username: z.string(),
lastname: z.string(),
firstname: z.string(),
ssn: zodSsn,
ssn: ssnSchema,
henkiloOid: z.string(),
principalOrganization: z.array(PrincipalOrganizationSchema),
roles: z.array(z.object({ role: z.string() })).optional()
Expand Down Expand Up @@ -143,7 +143,7 @@ export const UserSchoolSchema = z.object({

export type User = z.infer<typeof UserSchema>
export const UserSchema = StoredUserDetailsSchema.extend({
ssn: zodSsn,
ssn: ssnSchema,
userAccountId: z.string(),
schools: z.array(UserSchoolSchema),
censoring: CensoringSchema.optional(),
Expand All @@ -152,7 +152,7 @@ export const UserSchema = StoredUserDetailsSchema.extend({

export type UserToUpsert = z.infer<typeof UserToUpsertSchema>
export const UserToUpsertSchema = UserDetailsSchema.extend({
ssn: zodSsn,
ssn: ssnSchema,
schools: z.array(UserSchoolToUpsertSchema),
censoring: CensoringSchema.optional()
}).strict()
Expand Down Expand Up @@ -185,7 +185,7 @@ export const UserForAuthenticationSchema = z.xor([UserSchema, ImpersonatedUserSc
export type UserWithSchoolRoleAndSchoolId = z.infer<typeof UserWithSchoolRoleAndSchoolIdSchema>
export const UserWithSchoolRoleAndSchoolIdSchema = z.object({
userAccountId: z.string(),
ssn: zodSsn,
ssn: ssnSchema,
userDetails: UserDetailsSchema,
name: z.string(),
allowedExams: z.array(z.string()),
Expand Down
Loading
Loading