2022-06-01 08:39:31 +00:00
|
|
|
import type { Application } from 'express';
|
|
|
|
|
|
|
|
export default (app: Application) => {
|
|
|
|
app.post('/gitlab-api/api/graphql', (_req, res) => {
|
|
|
|
res.status(200).send({
|
|
|
|
'data': {
|
|
|
|
'currentUser': {
|
|
|
|
'publicEmail': null,
|
|
|
|
'name': 'Mark Kim',
|
|
|
|
'avatarUrl': null,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2024-04-29 13:58:16 +00:00
|
|
|
app.get('/v1/oauth/gitlab/config', (_req, res) => {
|
2022-06-01 08:39:31 +00:00
|
|
|
res.status(200).send({
|
|
|
|
applicationId: 'gitlab-oauth-client-id',
|
|
|
|
redirectUri: 'http://localhost:3000/not-implemented',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
app.post('/gitlab-api/oauth/token', (_req, res) => {
|
|
|
|
res.status(200).send({
|
|
|
|
'access_token': '123456789',
|
|
|
|
'created_at': 1652246628,
|
|
|
|
'expires_in': 6955,
|
|
|
|
'refresh_token': '1234567891',
|
|
|
|
scope: 'api read_user write_repository read_repository email',
|
|
|
|
'token_type': 'Bearer',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
app.post('/gitlab-api/oauth/authorize', (_req, res) => {
|
|
|
|
res.status(200).send({
|
|
|
|
'access_token': '123456789',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|