Skip to content

Secrets verification#149

Open
Nareshp1 wants to merge 44 commits intomainfrom
secrets-verification
Open

Secrets verification#149
Nareshp1 wants to merge 44 commits intomainfrom
secrets-verification

Conversation

@Nareshp1
Copy link
Copy Markdown
Member

@Nareshp1 Nareshp1 commented Jul 30, 2025

Checklist

  • I have added a version label to my PR (e.g., patch, minor, major).
  • I have tested my changes locally and verified they work as expected.
  • I have added relevant tests to cover my changes.
  • I have made any necessary updates to the documentation.
  • I have made any necessary updates to the CLI.
  • I have made any necessary updates to the frontend.

Description

Created a single, unified endpoint for adding secrets to a user account. Based on the provider specified, the endpoint will attempt to authenticate to the provider account the secrets are linked to and check that the minimum permissions (if needed, ex. cloud providers) are present before storing the secrets in the database for the user.

Fixes: #69

Nareshp1 and others added 21 commits July 20, 2025 10:23
…for updating provider credentials before sending it to the endpoint.
Copilot AI review requested due to automatic review settings July 30, 2025 22:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a unified secrets verification endpoint that validates and stores cloud provider credentials. It replaces separate provider-specific endpoints with a single endpoint that verifies credentials against the provider account before storage.

  • Unified single /api/v1/users/me/secrets endpoint for all cloud providers
  • Added credential verification using provider SDKs (boto3 for AWS)
  • Refactored frontend to use tabbed interface for different providers

Reviewed Changes

Copilot reviewed 21 out of 22 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
frontend/src/routes/settings/+page.svelte Converted from side-by-side layout to tabbed interface for cloud credentials
frontend/src/lib/types/api.ts Updated API types to use unified secrets request/response schemas
frontend/src/lib/api.ts Replaced provider-specific API calls with unified updateSecrets function
cli/internal/client/auth.go Updated CLI client to use new unified secrets endpoint
api/src/app/schemas/secret_schema.py Added validation for AWS credential format and length
api/src/app/schemas/creds_verify_schema.py New schema for credential verification requests
api/src/app/crud/crud_secrets.py New CRUD operations for user secrets management
api/src/app/cloud/ New credential verification framework with AWS implementation
api/src/app/api/v1/users.py Replaced separate endpoints with unified secrets verification endpoint
api/requirements.txt Added boto3 dependency for AWS verification
api/tests/ Comprehensive test coverage for new verification functionality
Comments suppressed due to low confidence (1)

frontend/src/lib/api.ts:163

  • The parameter name 'credentialprovider' should be renamed to 'provider' for consistency with the request schema and better readability.
  updateSecrets: async (credentialprovider: string, payload: any): Promise<ApiResponse<SecretsResponse>> => {

@Nareshp1 Nareshp1 added the minor Increment the minor version when merged label Jul 30, 2025
@alexchristy
Copy link
Copy Markdown
Member

Great work! This will really help with preventing a whole bunch of user errors, especially when they are onboarding for the first time

@Nareshp1 Nareshp1 added backend Related to the OpenLabs backend/API aws AWS related issues and PRs labels Aug 2, 2025
Copy link
Copy Markdown
Member

@alexchristy alexchristy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image Image

When testing the frontend, the error message breaks when the credentials aren't the correct length. When one or the other credential entry it gives just one [object Object] and when both are incorrect length you get two of them.

@Nareshp1
Copy link
Copy Markdown
Member Author

Nareshp1 commented Aug 6, 2025

Fixed issue with error output (specifically with the pydantic errors that are returned with invalid payloads). When the schema validation passes, the regular error messages returned from the endpoint also work still.
image
image
image
image

Copy link
Copy Markdown
Member

@alexchristy alexchristy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tested and everything is working great!

@Adamkadaban
Copy link
Copy Markdown
Member

I can't remember why I didn't approve this. Maybe I just got busy
@Nareshp1 is this finished?

@Adamkadaban Adamkadaban mentioned this pull request Dec 31, 2025
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aws AWS related issues and PRs backend Related to the OpenLabs backend/API minor Increment the minor version when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Verify that cloud secrets work before adding to DB

4 participants