Closed newtoallofthis123 closed 4 months ago
@Shinyzenith I am tagging you as you asked :)
Hi @newtoallofthis123 from a preliminary view, things look great as we discussed. Can we expand this for swhkd too? If you'd like to impl that in a separate pr then let me know!
Yes. This PR mostly aims to refactor the swhks code. I was planning on opening a similar PR for swhkd once this got approved, however, if need be I can combine it with this. However, a separate PR would be ideal I feel.
Thanks for the review 😊
Cool, we can do that separately, let me just get zubairs opinion on this too before I merge.
CC: @zubairmh
Hi it seems you also need to format your code make check
.
Done! Just ran make check
Hopefully that resolves the workflows 😄 and I also removed the .gitignore
commit
This PR implements the following changes, these changes have been limited to
swhks
for feedback and review, but they can be extended into the actualswhkd
as well.1. Env Struct
The env struct is used to centrally handle all the environment related queries and initializations. It is opened as a thread safe
OnceLock
variable and hence is ideal for servers2. Better Error Handling
Error handling related to env is now centrally handled in the Env struct itself using typecasted enumerations
3. PathBuf implementations
Paths are now handled with
pathbufs
instead of format stringsThis PR lays the ground work in centralizing the Environment variable queries that would help abstract away all the individual queries. This could especially be helpful when we modify the privilege model since we would now need to do changes in only a few places
Additionally, this has been tested individually and cargo linted as well
Feedback and any changes required are appreciated 😄