Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate referential integrity and logical integrity of datatypes in schema #10

Open
aahnik opened this issue Feb 28, 2024 · 0 comments
Labels
backend Issues regarding backend application

Comments

@aahnik
Copy link
Member

aahnik commented Feb 28, 2024

The first pr #1 creates endpoints with only basic datatype validation. The admins are expected to enter logically correct data, and the API is expected to be used from an interface only by admins.

For more robust security, we will ship referential integrity constraints and logical integrity constraints in upcoming PRs

for example in the team schema contains MemberRoleD and DomainRoleD types

export class MemberRoleD {
  user: ObjectId; // id of user
  roleStartDate?: Date;
  roleEndDate?: Date;
}

export class DomainRoleD {
  domain: ObjectId; // id of domain
  domainLeads: MemberRoleD[];
  members: MemberRoleD[];
}

in future we must verify:

  • whether if user: ObjectId is a valid object id pointing to an user existing in db
  • and similarly for domain:ObjectID
  • we need to verify whether values of roleStartDate and roleEndDate are within logical bounds, and whether roleEndDate comes after roleStartDate
@aahnik aahnik added the backend Issues regarding backend application label Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Issues regarding backend application
Projects
None yet
Development

No branches or pull requests

1 participant