Repository navigation
Add SciLaxy account device access to lab CLI - #16
Merged
Merged
Conversation
审查者指南此 PR 为 SciLaxy API 登录和设备列表的时序图sequenceDiagram
actor User
participant LabCLI
participant SciLaxyAPI
participant CredentialFile
User->>LabCLI: lab api login --server SERVER
LabCLI->>LabCLI: parse_server()
LabCLI->>User: prompt_password()
User-->>LabCLI: OpenSDL API token
LabCLI->>LabCLI: http_client()
LabCLI->>SciLaxyAPI: 使用 bearer token 获取 GET /liyanlabs/api/v1/osdl/me
SciLaxyAPI-->>LabCLI: 成功响应
LabCLI->>CredentialFile: save_credentials()
LabCLI-->>User: 已完成身份验证
User->>LabCLI: lab api devices
LabCLI->>CredentialFile: read_credentials()
CredentialFile-->>LabCLI: 服务器和令牌
LabCLI->>SciLaxyAPI: 使用 bearer token 获取 GET /liyanlabs/api/v1/osdl/devices
SciLaxyAPI-->>LabCLI: 运行器和设备
LabCLI-->>User: 在线设备
文件级变更
提示和命令与 Sourcery 交互
自定义你的使用体验访问你的控制面板:
获取帮助Original review guide in EnglishReviewer's GuideThis PR introduces a new Sequence diagram for SciLaxy API login and device listingsequenceDiagram
actor User
participant LabCLI
participant SciLaxyAPI
participant CredentialFile
User->>LabCLI: lab api login --server SERVER
LabCLI->>LabCLI: parse_server()
LabCLI->>User: prompt_password()
User-->>LabCLI: OpenSDL API token
LabCLI->>LabCLI: http_client()
LabCLI->>SciLaxyAPI: GET /liyanlabs/api/v1/osdl/me with bearer token
SciLaxyAPI-->>LabCLI: successful response
LabCLI->>CredentialFile: save_credentials()
LabCLI-->>User: Authenticated
User->>LabCLI: lab api devices
LabCLI->>CredentialFile: read_credentials()
CredentialFile-->>LabCLI: server and token
LabCLI->>SciLaxyAPI: GET /liyanlabs/api/v1/osdl/devices with bearer token
SciLaxyAPI-->>LabCLI: runners and devices
LabCLI-->>User: online devices
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lab api login,lab api devices, andlab api logoutfor SciLaxy account access.Verification
cargo fmt --all --checkCARGO_INCREMENTAL=0 cargo test -p lab-cli --locked --bin lab --test cli_surfaceThe SciLaxy API routes are added in the companion Liyan PR #10.