-
Notifications
You must be signed in to change notification settings - Fork 30
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
Make the usage of the registration bot configurable #130
Conversation
This approach seems a little safer to me. |
Proposal: How about we allow a list of addresses to bind to in the config.toml? Something like,
|
A few questions: How does the server know which address to choose for which type of connection (bot vs. client, testing vs deployment, etc.)? It also seems like the second address in the list is an unencrypted connection (as opposed to the first one with TLS settings) -- do we want to have a non-TLS option? What does the |
Currently, the keyserver doesn't know anything about bots; it just listens on two addresses, with differing permission. The only change here is really to make that configurable, instead of hardcoded.
I figured the safest default would be to disallow registration on all addresses, and for the unix socket you'd explicitly enable it.
Maybe not. |
Does "disallow registration on all addresses" mean "all addresses can accept any request except registration"? Otherwise this totally makes sense to me. |
Yup. All the other request are of the "read" type. Registration is the only "write". If you want to think about it like that. So, by default, addresses are "read-only". |
Fair point, I agree that this is a good way to think about it. |
58327ab
to
88103d4
Compare
I gave it a shot in 88103d43a14cf9d19046df90da823025dae32b84. |
Nice work. |
495e9f5
to
fdb5b72
Compare
|
||
// test TCP network | ||
addr := &Address{ | ||
Address: "tcp:" + testutil.PublicConnection, |
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.
tcp:// ?
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.
Maybe just change testutil.PublicConnection
to include the protocol?
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 think the latest is here: https://github.com/coniks-sys/coniks-go/pull/130/files#diff-d24d2023b15c72fdfbc6fec8561dcf0dR55 Sorry, my mistake.
Maybe just change testutil.PublicConnection to include the protocol?
Yes, it should be a constant instead.
|
||
// test Unix network | ||
addr = &Address{ | ||
Address: "unix:" + testutil.LocalConnection, |
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.
unix:// ?
panic(err) | ||
for i := 0; i < len(addrs); i++ { | ||
addr := addrs[i] | ||
ln, tlsConfig, perms := resolveAndListen(addr) |
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.
Do you think it's worth logging a warning if none of the addresses permit registration?
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.
Yes, it makes sense. Added in 0f78e49ac4b22a8051818f30f103e7e74f2abf28. Thanks!
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
Alright, good to merge. |
Yes, wait me for one sec. |
@c633 Maybe this is a silly question, how does one configure the server to use/not use the registration bot? It seems like the server default (i.e. in |
Maybe a better framing is to say that the default configuration is to only allow local registrations, and if you want to deviate, you need to manually edit. We leave the bot out of the picture. |
That works I guess (a flag for init may be more convenient, though I realize that may be difficult to implement). This isn't stated in the README or anywhere yet. Will have to add that. |
Thanks! |
Which do you prefer:
LocalAddress
to an empty string to disable the registration botIsUseBot
field inServerConfig
?