Add allowed status endpoint for AI Assist
What does this MR do and why?
Describe in detail what your merge request does and why.
This MR adds the module ML
to EE licensed features with the first endpoint being aiassist
.
asassist
is a GET
endpoint used to check if a user is allowed to use AI Assist in the VS Code extension. The endpoint will be called server side (once per hour) to ensure GitLab has control over which users are using our resources. At the moment the criteria is 1) ultimate customer and 2) feature flag enabled.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Run GDK
- Retrieve an access token for a user
export GITLAB_PAT=<your api token>
- Call the end point
curl --request GET --header "PRIVATE-TOKEN: $GITLAB_PAT" "http://127.0.0.1:3000/api/v4/ml/aiassist"
Output:
{"user_is_allowed":false}
- Enable the feature flag
rails console
Feature.enable(:ai_assist)
- Call the end point
curl --request GET --header "PRIVATE-TOKEN: $GITLAB_PAT" "http://127.0.0.1:3000/api/v4/ml/aiassist"
Output:
{"user_is_allowed":true}
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.