dropbox-sdk-rust
dropbox-sdk-rust copied to clipboard
make pkcecode string pub to support serialization
The purpose of this change is to support the following scenario: I am writing an app to be as scriptable (non-directly-interactive) as possible. When doing the PKCE auth procedure, it outputs the auth URL and terminates. The user can go to the URL, get the password, and invoke my app again later with this information to finish the procedure. However, this requires that my app save the PKCE code somewhere between invocations. It's just a string so it's easy to store. The problem is, dropbox-sdk has chosen to wrap it in a single field struct where the code is private, there aren't any setters or getters, and it can't be constructed with a provided value, so I can't get the code out (or back in) by any safe means. Therefore my app currently uses unsafe rust (transmute) to make the code accessible so it can work in this way. If the field was pub then this scenario would be much more straightforward.
Please let me know if I am off base and should be doing this a different way altogether.
Checklist
General Contributing
- [x] I have read the Code of Conduct and signed the CLA.
- [x] I have added an entry to the
RELEASE_NOTES.md
file, or believe it's not necessary for this change.
Validation
This change doesn't add any new functionality