Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor with minor improvements, and add README #5

Merged
merged 22 commits into from
Aug 13, 2024

Conversation

stevapple
Copy link
Contributor

@stevapple stevapple commented Jul 30, 2024

This PR intends to re-organize all the codes into different "submodules". Most notably, it removes all global variables and wraps all the functionalities into classes with minor changes to the behavior, enabling more precise testing. recovery-token is added as an optional configuration, and logger is no longer required.

This PR also adds a concrete README on all the configurable options and the API design.

@stevapple
Copy link
Contributor Author

There should be subsequent "breaking" PRs, including a better config representation (maybe TOML?), transferring some responsibilities to the API server, more customization, etc.

auth.go Outdated Show resolved Hide resolved
@stevapple stevapple marked this pull request as ready for review August 12, 2024 15:46
@stevapple stevapple changed the title [NFC] Refactor [NFC] Refactor and add README Aug 12, 2024
@stevapple stevapple requested a review from iBug August 12, 2024 15:47
@stevapple
Copy link
Contributor Author

cc @taoky . I’m especially unsure about the role of token in the API server and Vlab recovery system.

@taoky
Copy link
Member

taoky commented Aug 12, 2024

cc @taoky . I’m especially unsure about the role of token in the API server and Vlab recovery system.

API server and recovery backend are two different applications, though currently they're using the same token...

@stevapple
Copy link
Contributor Author

API server and recovery backend are two different applications, though currently they're using the same token...

So the API server also requires token for safety reason?

@iBug
Copy link
Member

iBug commented Aug 12, 2024

So the API server also requires token for safety reason?

I'm fine if you're splitting it into two tokens and mark RecoveryToken as optional.

@taoky
Copy link
Member

taoky commented Aug 12, 2024

API server and recovery backend are two different applications, though currently they're using the same token...

So the API server also requires token for safety reason?

Yes.

@iBug
Copy link
Member

iBug commented Aug 12, 2024

I'm especially unsure about the role of token in the API server and Vlab recovery system.

The recovery-sshd server lives in another private repo. It accepts plain SSH requests with username being one of recovery, console or serial matching those described here, and password being <VMID> <token> (concatenation of both items separated by a single space). The token is there against arbitrary access as these recovery access methods are inherently of very high privileges in the VM.

Not sure why we didn't open-source recovery-sshd. The repo contains no secret beyond what could certainly be deemed "implementation details".

logging.go Show resolved Hide resolved
@stevapple
Copy link
Contributor Author

I'm fine if you're splitting it into two tokens and mark RecoveryToken as optional.

Done.

@stevapple stevapple changed the title [NFC] Refactor and add README Refactor with minor improvements, and add README Aug 12, 2024
@iBug
Copy link
Member

iBug commented Aug 12, 2024

@taoky We can merge this PR at any time, but before we deploy it you'll have to update our Django server to adapt to the new API request/response schema.

README.md Show resolved Hide resolved
@stevapple
Copy link
Contributor Author

@iBug I don’t think we introduced any breaking change since v0.0.7…? All the features and improvements are purely additional.

README.md Outdated Show resolved Hide resolved
@iBug
Copy link
Member

iBug commented Aug 13, 2024

Would you like a chance to reorganize these commits so that they're suitable for a merge commit? Or would you mind if this large change shows as a single commit in the history?

@stevapple
Copy link
Contributor Author

I would always prefer a squash merge:) If you don’t mind, please clean up the message body so it won’t be flooded by those commits.

@iBug iBug merged commit 883bd0d into USTC-vlab:master Aug 13, 2024
2 checks passed
@stevapple stevapple deleted the gardening branch August 13, 2024 08:39
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.

3 participants