-
Notifications
You must be signed in to change notification settings - Fork 69
feat(rust): allow authenticating into multiple hosts #2278
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
Conversation
55e7d76 to
8734185
Compare
teclator
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ancorgs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm the conflict was properly resolved. I didn't check the rest, but I will rely on previous @teclator approval to say that this LGTM.
mvidner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When there is any problem with the file storing the authentication tokens, do we tell the user where it is (agama auth login --help?) or do they have to resort to strace?
Also, my testing use cases involve multiple agamas on the same host but different ports. I hope it continues to work :)
| #[error("Unexpected type on D-Bus '{0}'")] | ||
| ZVariant(#[from] zvariant::Error), | ||
| #[error("Failed to communicate with the HTTP backend '{0}'")] | ||
| #[error(transparent)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat!
Prepare to release Agama 14: * #1994 * #2041 * #2103 * #2178 * #2189 * #2200 * #2205 * #2209 * #2212 * #2213 * #2214 * #2215 * #2216 * #2217 * #2219 * #2220 * #2224 * #2225 * #2226 * #2227 * #2228 * #2230 * #2231 * #2232 * #2233 * #2235 * #2237 * #2239 * #2241 * #2242 * #2244 * #2245 * #2246 * #2247 * #2248 * #2249 * #2250 * #2251 * #2252 * #2253 * #2254 * #2255 * #2256 * #2257 * #2259 * #2260 * #2262 * #2265 * #2266 * #2268 * #2269 * #2271 * #2272 * #2273 * #2275 * #2276 * #2278 * #2281
Problems
agama auth show).Solution
Storing one token per host
Instead of storing the token in
$HOME/.agama/token, use a file ($HOME/.local/share/agama) containing all tokens (one per host). For instance:{ "192.168.122.145": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3NDUzMTg2MTV9.G36w8NQ-ZCAkCQGGwjajRpd8EfkOM8fFLLfGjzTAqP0" }Do not ask for insecure connections
If there is a problem when connecting to the API, just report the error (no matter whether it is an SSL problem or not). The user can use the
--insecureflag to disable certificate checks.Testing