Skip to content

Commit 6fccf11

Browse files
committed
feat: add credentials validation for knowledge server
1 parent 8209c28 commit 6fccf11

File tree

1 file changed

+5
-0
lines changed
  • src/datapilot/core/knowledge

1 file changed

+5
-0
lines changed

src/datapilot/core/knowledge/cli.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from datapilot.cli.decorators import auth_options
66

7+
from ...clients.altimate.utils import validate_credentials
78
from .server import KnowledgeBaseHandler
89

910

@@ -23,6 +24,10 @@ def serve(token, instance_name, backend_url, port):
2324
)
2425
raise click.Abort
2526

27+
if not validate_credentials(token, backend_url, instance_name):
28+
click.echo("Error: Invalid credentials.")
29+
raise click.Abort
30+
2631
# Set context data for the handler
2732
KnowledgeBaseHandler.token = token
2833
KnowledgeBaseHandler.instance_name = instance_name

0 commit comments

Comments
 (0)