feat(webpage): showing you the menu, hopefully it works??
This commit is contained in:
parent
bd0b9c9a52
commit
a727696e5b
51 changed files with 8573 additions and 688 deletions
|
|
@ -2,6 +2,8 @@ fastapi[standard]
|
|||
google-genai
|
||||
python-dotenv
|
||||
pydantic
|
||||
# JWT
|
||||
python-jose
|
||||
# Amazon Packages (Yes, you need `pyright` to use boto3-stubs)
|
||||
boto3
|
||||
boto3[crt]
|
||||
|
|
|
|||
18
api/src/api.py
Normal file
18
api/src/api.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Essential
|
||||
from uuid import uuid4
|
||||
from dotenv import load_dotenv
|
||||
|
||||
# API
|
||||
from fastapi import FastAPI
|
||||
|
||||
# Custom Modules
|
||||
from models import Message
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
# @app.post("/api/prompt")
|
||||
# def SubmitPrompt(message: Message):
|
||||
# message.id = uuid4()
|
||||
# message.conversation_id =
|
||||
# message.sender_id =
|
||||
# message.type =
|
||||
|
|
@ -5,18 +5,23 @@ from main import (
|
|||
KEYCLOAK_ADMIN_PASSWORD,
|
||||
KEYCLOAK_REALM_NAME,
|
||||
KEYCLOAK_CLIENT_ID,
|
||||
KEYCLOAK_CLIENT_SECRET,
|
||||
)
|
||||
|
||||
# Keycloak
|
||||
from keycloak import KeycloakOpenIDConnection, KeycloakAdmin
|
||||
from keycloak import KeycloakOpenIDConnection, KeycloakAdmin, KeycloakOpenID
|
||||
|
||||
OIDC_Connect = KeycloakOpenIDConnection(
|
||||
admin_connection = KeycloakOpenIDConnection(
|
||||
server_url=KEYCLOAK_URL,
|
||||
username=KEYCLOAK_ADMIN_USERNAME,
|
||||
password=KEYCLOAK_ADMIN_PASSWORD,
|
||||
realm_name=KEYCLOAK_REALM_NAME,
|
||||
client_id=str(KEYCLOAK_CLIENT_ID),
|
||||
client_secret_key=KEYCLOAK_CLIENT_SECRET,
|
||||
verify=True,
|
||||
)
|
||||
|
||||
admin = KeycloakAdmin(connection=OIDC_Connect)
|
||||
admin_client = KeycloakAdmin(connection=admin_connection)
|
||||
|
||||
|
||||
print(admin_client.get_user_id("fbla_dev"))
|
||||
|
|
|
|||
|
|
@ -1,13 +1,6 @@
|
|||
# Essential / Compliments
|
||||
# Essential
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
from uuid import uuid4
|
||||
|
||||
# API
|
||||
from fastapi import FastAPI
|
||||
|
||||
# Custom Modules
|
||||
from models import Message
|
||||
|
||||
# Load environment variables
|
||||
load_dotenv()
|
||||
|
|
@ -22,18 +15,18 @@ KEYCLOAK_ADMIN_USERNAME = os.getenv("KEYCLOAK_ADMIN_USERNAME")
|
|||
KEYCLOAK_ADMIN_PASSWORD = os.getenv("KEYCLOAK_ADMIN_PASSWORD")
|
||||
KEYCLOAK_REALM_NAME = os.getenv("KEYCLOAK_REALM_NAME")
|
||||
KEYCLOAK_CLIENT_ID = os.getenv("KEYCLOAK_CLIENT_ID")
|
||||
KEYCLOAK_CLIENT_SECRET = os.getenv("KEYCLOAK_CLIENT_SECRET")
|
||||
|
||||
# Debugging
|
||||
# print(GEMINI_KEY)
|
||||
# print(S3_ACCESS_KEY)
|
||||
# print(S3_SECRET_KEY)
|
||||
# print(S3_URL)
|
||||
|
||||
# app = FastAPI()
|
||||
|
||||
# @app.post("/api/prompt")
|
||||
# def SubmitPrompt(message: Message):
|
||||
# message.id = uuid4()
|
||||
# message.conversation_id =
|
||||
# message.sender_id =
|
||||
# message.type =
|
||||
print(
|
||||
"AI KEY: " + str(AI_API_KEY) + "\n"
|
||||
"S3 ACCESS KEY: " + str(S3_ACCESS_KEY) + "\n"
|
||||
"S3 SECRET KEY: " + str(S3_SECRET_KEY) + "\n"
|
||||
"S3 URL: " + str(S3_URL) + "\n"
|
||||
"KEYCLOAK URL: " + str(KEYCLOAK_URL) + "\n"
|
||||
"KEYCLOAK ADMIN USERNAME: " + str(KEYCLOAK_ADMIN_USERNAME) + "\n"
|
||||
"KEYCLOAK ADMIN PASSWORD: " + str(KEYCLOAK_ADMIN_PASSWORD) + "\n"
|
||||
"KEYCLOAK REALM NAME: " + str(KEYCLOAK_REALM_NAME) + "\n"
|
||||
"KEYCLOAK CLIENT ID: " + str(KEYCLOAK_CLIENT_ID) + "\n"
|
||||
"KEYCLOAK CLIENT SECRET: " + str(KEYCLOAK_CLIENT_SECRET) + "\n"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue