Skip to content

Aakash - Add SDK support for Request New Account feature - #68

Merged
llam36 merged 1 commit into
mainfrom
aakash/request-new-acc
Feb 24, 2026
Merged

llam36 merged 1 commit into
mainfrom
aakash/request-new-acc

Conversation

@aakashg00

Copy link
Copy Markdown
Contributor

Created SDK methods that call the Juno API endpoints created in this PR so that the SDK can be used to request new accounts.
Resolves this ticket in the main Juno repo.

@aakashg00
aakashg00 marked this pull request as ready for review February 20, 2026 23:36
@aakashg00
aakashg00 requested a review from llam36 February 20, 2026 23:36
@greptile-apps

greptile-apps Bot commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Added SDK support for the Request New Account feature by implementing three new API methods in the AuthAPI class: requestNewAccount (for prospective users to submit account requests), getAllAccountRequests (for admins to retrieve all pending requests), and deleteAccountRequest (for admins to remove requests). The implementation includes proper input validation using existing validation patterns, credential-based authentication for admin operations, and appropriate TypeScript models auto-generated from the OpenAPI specification. Most changes are auto-generated code from the OpenAPI Generator based on the Juno API specification.

Key Changes:

  • New public methods in src/lib/auth.ts with consistent validation and error handling
  • Auto-generated API controllers in src/internal/api/authApi.ts for the three endpoints
  • Three new TypeScript models: RequestNewAccountModel, NewAccountRequestResponse, NewAccountRequestsResponse
  • Minor import reorganization in analytics API files (cosmetic, auto-generated)

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes follow established patterns in the codebase, use proper validation consistent with existing methods, and are primarily auto-generated from the OpenAPI specification. The implementation is straightforward, adding new functionality without modifying existing code paths. Input validation follows the same pattern as other methods in the AuthAPI class, and authentication is properly handled for admin-only operations.
  • No files require special attention

Important Files Changed

Filename Overview
src/lib/auth.ts Added three new methods for account request management: requestNewAccount, getAllAccountRequests, and deleteAccountRequest with proper validation and error handling
src/internal/api/authApi.ts Added three auto-generated API controller methods for account request CRUD operations with proper authentication and serialization
src/internal/model/requestNewAccountModel.ts New auto-generated model for account request input with email, name, password, userType enum, and optional projectName
src/internal/model/newAccountRequestResponse.ts New auto-generated response model including id, timestamps, and request details
src/internal/model/newAccountRequestsResponse.ts New auto-generated wrapper model containing array of account requests

Sequence Diagram

sequenceDiagram
    participant User
    participant AuthAPI
    participant AuthApi (Internal)
    participant Juno API

    Note over User,Juno API: Request New Account Flow
    User->>AuthAPI: requestNewAccount({email, name, password, userType, projectName?})
    AuthAPI->>AuthAPI: Validate inputs (email, name, password)
    AuthAPI->>AuthAPI: Trim inputs
    AuthAPI->>AuthApi (Internal): authControllerCreateAccountRequest(requestNewAccountModel)
    AuthApi (Internal)->>Juno API: POST /auth/account-request
    Juno API-->>AuthApi (Internal): NewAccountRequestResponse
    AuthApi (Internal)-->>AuthAPI: Response body
    AuthAPI-->>User: NewAccountRequestResponse

    Note over User,Juno API: Get All Account Requests Flow (Admin)
    User->>AuthAPI: getAllAccountRequests({email, password})
    AuthAPI->>AuthAPI: Validate admin credentials
    AuthAPI->>AuthApi (Internal): authControllerGetAllAccountRequests(password, email)
    AuthApi (Internal)->>AuthApi (Internal): Apply API_Key authentication
    AuthApi (Internal)->>Juno API: GET /auth/account-request (with X-User-Email, X-User-Password headers)
    Juno API-->>AuthApi (Internal): NewAccountRequestsResponse
    AuthApi (Internal)-->>AuthAPI: Response body
    AuthAPI-->>User: NewAccountRequestsResponse

    Note over User,Juno API: Delete Account Request Flow (Admin)
    User->>AuthAPI: deleteAccountRequest({id, email, password})
    AuthAPI->>AuthAPI: Validate id and credentials
    AuthAPI->>AuthApi (Internal): authControllerDeleteAccountRequest(id, password, email)
    AuthApi (Internal)->>AuthApi (Internal): Apply API_Key authentication
    AuthApi (Internal)->>Juno API: DELETE /auth/account-request/{id} (with X-User-Email, X-User-Password headers)
    Juno API-->>AuthApi (Internal): NewAccountRequestResponse
    AuthApi (Internal)-->>AuthAPI: Response body
    AuthAPI-->>User: NewAccountRequestResponse
Loading

Last reviewed commit: be46c8f

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

11 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@llam36 llam36 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@llam36
llam36 merged commit 23248c1 into main Feb 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Spring 2026] Request New Account Backend

2 participants