xebia-functional / xef

Building applications with LLMs through composability, in Kotlin, Scala, ...

Home Page:https://xef.ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Authentication in Xef Server

javipacheco opened this issue · comments

The objective of this issue is to create a way to store organizations, projects and users in the server and find a way to create tokens for each user.

The provider tokens (OpenAI. Google Cloud, etc.) should be stored in the database for every user and should be used in the endpoint depending on the model

Relations proposal:

flowchart TD
    A[Users]
    B[Projects]
    C[Organisation] 
    D[Tokens]
    A -->|n - n| C
    B -->|1 - n| C
    D -->|1 - n| A
    D -->|1 - 1| B

The server is going to contain 4 entities in order to manage authorization in our calls:

  • Organisation: contains the name of the different organisations
  • Projects: all of the projects where we can create tokens. This entity has a relationship to Organization
  • Users: the users must have permission in the organization in order to be able to create token in the projects
  • Tokens: this entity has a relationship to Users and Projects and contains the real token for OpenAI and Google Cloud. This entity also has a xef-token that we are going to use in our calls to AI