Resolve "Add Personal Access Token (PAT)"
Closes #2456 (closed)
- follow up MR: list support filter parameters
gitlab implementation for my reference:
- Personal access tokens API: https://docs.gitlab.com/api/personal_access_tokens/
- PAT datamodel: https://gitlab.com/gitlab-org/gitlab/-/blob/master/db/structure.sql?ref_type=heads
- GitLab token overview: https://docs.gitlab.com/security/tokens/
CREATE TABLE personal_access_tokens (
id bigint NOT NULL,
user_id bigint NOT NULL,
name character varying NOT NULL,
revoked boolean DEFAULT false,
expires_at date,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
scopes character varying DEFAULT '--- []
'::character varying NOT NULL,
impersonation boolean DEFAULT false NOT NULL,
token_digest character varying,
expire_notification_delivered boolean DEFAULT false NOT NULL,
last_used_at timestamp with time zone,
after_expiry_notification_delivered boolean DEFAULT false NOT NULL,
previous_personal_access_token_id bigint,
organization_id bigint NOT NULL,
seven_days_notification_sent_at timestamp with time zone,
thirty_days_notification_sent_at timestamp with time zone,
sixty_days_notification_sent_at timestamp with time zone,
description text,
group_id bigint,
user_type smallint,
granular boolean DEFAULT false NOT NULL,
CONSTRAINT check_6d2ddc9355 CHECK ((char_length(description) <= 255))
);
Edited by Haoyu Yang