Allow to set a date and exact time in expires_at parameter on members (group and project) API endpoint
Problem to solve
Allow expires_at
parameter to accept a date and a time to improve repository management by admin. Now it is possible to set the only day and there is no way to give access until the exact date and time.
API documentation: https://docs.gitlab.com/ee/api/members.html
For example, the request below will allow access as Maintainer until 2019-03-22
and passed time will be ignored and set to 12:00 AM
curl -X POST --header "PRIVATE-TOKEN: Token" 'https://gitlab.com/api/v4/projects/11093638/members?user_id=2378463&access_level=40&expires_at=2019-03-22T20:19:20Z'
Proposal
Instead of this behavior will be more correct to accept passed time with date and to set access until the exact time. There are scalability considerations to make when implementing this issue. Currently we have a job running once a day that expires members. Introducing time selection means we would need to run this job possibly every minute. We could perhaps consider only accepting the full hour for the time parameter.
UX: TBD
Target audience
- Delaney, Development Team Lead, https://about.gitlab.com/handbook/marketing/product-marketing/roles-personas#delaney-development-team-lead
- Sasha, Software Developer, https://about.gitlab.com/handbook/marketing/product-marketing/roles-personas#sasha-software-developer
Permissions and Security
API, UI, repository ownership
Implementation guide
-
Correct the sample responses in the member API doc. -
Change the expires_at column type from date to timestamp following this doc. See #464443 (closed). -
Update the RemoveExpiredMembersWorker to expire members at a particular time. -
Update the member API doc again with the new data type and the sample responses as well.