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

List all invitations for a given user #9712

Open
mmmarcos opened this issue Feb 14, 2025 · 0 comments · May be fixed by #9813
Open

List all invitations for a given user #9712

mmmarcos opened this issue Feb 14, 2025 · 0 comments · May be fixed by #9813
Assignees
Milestone

Comments

@mmmarcos
Copy link
Contributor

mmmarcos commented Feb 14, 2025

We want to list the invitations that a specific user as received in parsec-auth.

For that parsec-auth would need to request the server and it would need to perform a lookup in the invitations table searching for invitation with user_invitation_claimer_email=$email && type=USER:

CREATE TABLE invitation (
_id SERIAL PRIMARY KEY,
organization INTEGER REFERENCES organization (_id) NOT NULL,
token VARCHAR(32) NOT NULL,
type INVITATION_TYPE NOT NULL,
-- A more readable ordering of these columns would be:
--
-- -- Invitation created by either a device or a service
-- created_by_device INTEGER REFERENCES device (_id),
-- created_by_service_label VARCHAR(254),
--
-- -- Type specific fields
-- -- Required when type=USER
-- user_invitation_claimer_email VARCHAR(255),
-- -- Required when type=DEVICE
-- device_invitation_claimer INTEGER REFERENCES user_ (_id),
-- -- Required when type=SHAMIR_RECOVERY
-- shamir_recovery INTEGER REFERENCES shamir_recovery_setup (_id),
--
-- -- Other fields
-- created_on TIMESTAMPTZ NOT NULL,
-- deleted_on TIMESTAMPTZ,
-- deleted_reason INVITATION_DELETED_REASON,
-- Updated in migration 0009
created_by_device INTEGER REFERENCES device (_id),
-- Required when type=USER
user_invitation_claimer_email VARCHAR(255),
created_on TIMESTAMPTZ NOT NULL,
deleted_on TIMESTAMPTZ,
deleted_reason INVITATION_DELETED_REASON,
-- Required when type=SHAMIR_RECOVERY
shamir_recovery INTEGER REFERENCES shamir_recovery_setup (_id),
-- Added in migration 0009
created_by_service_label VARCHAR(254),
-- Required when type=DEVICE
device_invitation_claimer INTEGER REFERENCES user_ (_id),
UNIQUE (organization, token)
);

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 a pull request may close this issue.

2 participants