Skip to content

Do not merge/hackathon 2025 #968

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

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft

Do not merge/hackathon 2025 #968

wants to merge 15 commits into from

Conversation

qbey
Copy link
Member

@qbey qbey commented May 14, 2025

Purpose

Provide a branch to allow simple developments during the oncoming hackathon.

⚠️ This code is unsafe to use in production ⚠️

Please note the authentication in this PR is global and not restricted to some endpoints. We strongly advise to not deploy this as it is.

Add resource server authentication

Capture.video.du.2025-05-14.09-58-13.mp4

Add user token authentication

Capture.video.du.2025-05-14.15-00-46.mp4

Use with curl -X GET "http://localhost:8071/api/v1.0/documents/" -H "Authorization: Token <generated-token>"

Add a local MCP server

Thanks to the user token, we can deploy a local MCP server to use with cursor or mcphost.
Please check the documentation in ./src/mcp_server/README.md file.

Capture.video.du.2025-05-16.18-05-08.mp4
Capture.video.du.2025-05-19.11-33-55.mp4

Proposal

  • add resource server authentication
  • add user token authentication along with a simple (and AI written mostly, and not unit tested) page to mange those tokens
  • add a very simple MCP server prototype (based on user API token)

@qbey qbey force-pushed the do-not-merge/hackathon-2025 branch from d2d523e to aec1604 Compare May 16, 2025 07:51
@qbey qbey self-assigned this May 16, 2025
@qbey qbey force-pushed the do-not-merge/hackathon-2025 branch 3 times, most recently from 5719c0c to b73c31b Compare May 16, 2025 12:56
@qbey qbey force-pushed the do-not-merge/hackathon-2025 branch from 328f0e6 to 0f32206 Compare May 23, 2025 13:23
qbey added 3 commits May 26, 2025 11:39
Our authentication flow uses the Django authentication which creates a
session for the User. Then the session is used to make API calls,
therefore we don't need to accept OIDC tokens directly on the API.

Accepting the OIDC token on the API can allow to bypass the "resource
server mode" which allows to restrict provided information according to
the Service Provider which makes the request.
The previous `ServerToServerAuthentication` was raising authentication
failed error if anything is wrong (the header, the token) which prevents
any possibility to have several authentication backends.
This provides a base configuration to allow to access all
API via OIDC resource server authentication.
@qbey qbey force-pushed the do-not-merge/hackathon-2025 branch 2 times, most recently from 15b91ad to b7dff08 Compare May 26, 2025 12:29
This provides:
 - a frontend to allow user to create/delete User Token
 - the authentication process to allow any API to be called when
   authenticating with a User Token.
@qbey qbey force-pushed the do-not-merge/hackathon-2025 branch 8 times, most recently from 443a35a to 3d2f03c Compare May 28, 2025 08:07
qbey added 4 commits May 28, 2025 11:29
This provides a way to start a local MCP server:
 - provided a user token, the MCP can create document
 - can be run locally and work with cursor or mcphost
Provide the helm chart declaration to deploy the MCP server.
Publish the Docker images to deploy on a dedicated instance for the
Hackdays.
Publish the MCP Docker image on our registry.
@qbey qbey force-pushed the do-not-merge/hackathon-2025 branch 2 times, most recently from 667b8f9 to 4a81e15 Compare May 28, 2025 14:42
@AntoLC
Copy link
Collaborator

AntoLC commented Jun 3, 2025

Instance with this banch: https://docs-ia.beta.numerique.gouv.fr/

@AntoLC AntoLC self-assigned this Jun 3, 2025
AntoLC added 2 commits June 3, 2025 12:20
Get the content of a document in markdown format.
Ex: http://localhost:8071/api/v1.0/documents/<ID>/content/
@AntoLC AntoLC added the keep track Label to keep track of interesting things label Jun 5, 2025
@AntoLC AntoLC removed their assignment Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hack Days 2025 keep track Label to keep track of interesting things
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants