-
Notifications
You must be signed in to change notification settings - Fork 44
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
API endpoint for keys was accidentally changed #108
Labels
Bug
Incorrect Behavior
Comments
josecelano
added a commit
that referenced
this issue
Nov 22, 2022
The response for the enpoint POST /api/key/:seconds_valid should be: ```json { "key": "IaWDneuFNZi8IB4MPA3qW1CD0M30EZSM", "valid_until": 1674804892 } ``` instead of: ```json { "key": "IaWDneuFNZi8IB4MPA3qW1CD0M30EZSM", "valid_until": { "secs": 1674804892, "nanos": 423855037 } } ``` It was propagated to the API after changing the internal struct `AuthKey` from: ```rust pub struct AuthKey { pub key: String, pub valid_until: Option<u64>, } ``` to: ```rust pub struct AuthKey { pub key: String, pub valid_until: Option<DurationSinceUnixEpoch>, } ```
josecelano
added a commit
that referenced
this issue
Nov 22, 2022
josecelano
added a commit
that referenced
this issue
Nov 23, 2022
It seems we need to wait a little bit until the server is ready to accept requests.
josecelano
added a commit
that referenced
this issue
Nov 23, 2022
josecelano
added a commit
that referenced
this issue
Nov 23, 2022
josecelano
added a commit
that referenced
this issue
Nov 23, 2022
josecelano
added a commit
that referenced
this issue
Nov 23, 2022
josecelano
added a commit
that referenced
this issue
Nov 23, 2022
2 tasks
josecelano
added a commit
that referenced
this issue
Nov 23, 2022
The response for the enpoint POST /api/key/:seconds_valid should be: ```json { "key": "IaWDneuFNZi8IB4MPA3qW1CD0M30EZSM", "valid_until": 1674804892 } ``` instead of: ```json { "key": "IaWDneuFNZi8IB4MPA3qW1CD0M30EZSM", "valid_until": { "secs": 1674804892, "nanos": 423855037 } } ``` It was propagated to the API after changing the internal struct `AuthKey` from: ```rust pub struct AuthKey { pub key: String, pub valid_until: Option<u64>, } ``` to: ```rust pub struct AuthKey { pub key: String, pub valid_until: Option<DurationSinceUnixEpoch>, } ```
josecelano
added a commit
that referenced
this issue
Nov 23, 2022
da2ce7
added a commit
to da2ce7/torrust-tracker
that referenced
this issue
Nov 23, 2022
…n API endpoint 409f82a test: [torrust#108] add e2e test for auth key generation API endpoint (Jose Celano) ede0460 feat: [torrust#108] add dev dependency reqwest (Jose Celano) 23916a6 fix: [torrust#108] revert change in auth key generation endpoint (Jose Celano) Pull request description: Tasks: - [x] Revert change. - [x] E2E test for the endpoint. ACKs for top commit: da2ce7: ACK 409f82a Tree-SHA512: 66422f2ab68925581fde950b1d618899189160df1d0d07c747f833d909d44fe2f945d212362cd8454f1f9c384f67b1c4dffdde66ec5e175a1cd12114977e630d
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The tracker has an endpoint to generate new keys.
The response for that endpoint was like:
But now is like this:
The change was introduced in this commit cab093c by @da2ce7.
The struct:
changed to:
Since we automatically build the json objects exposed in the API, that change was exposed to API consumers.
This change affected the [backend](More info: torrust/torrust-index#78).
The text was updated successfully, but these errors were encountered: