Open
Conversation
lewishazell
reviewed
May 23, 2021
Member
lewishazell
left a comment
There was a problem hiding this comment.
I think it's ready. I'm happy to check server linking if need be.
Looks good!
| using Microsoft.Extensions.Options; | ||
|
|
||
| namespace cmpctircd.Validation { | ||
| public class ConfigurationOptionsValidator : AbstractValidator<IOptions<ConfigurationOptions>> { |
| services.AddOptions<ServerOptions>().Bind(configuration); | ||
| services.AddOptions<LoggerOptions>().Bind(configuration); | ||
| //services.AddOptions<ConfigurationOptions>().Bind(configuration); | ||
| services.Configure<ConfigurationOptions>(configuration); |
Member
There was a problem hiding this comment.
Exactly how I imagined this working, I like!
| try { | ||
| // Restrict the commands which non-registered (i.e. pre PONG, pre USER/NICK) users can execute | ||
| if ((client.State.Equals(ClientState.PreAuth) || (ircd.Config.Advanced.ResolveHostnames && client.ResolvingHost)) && !registrationCommands.Contains(packet.ToUpper())) { | ||
| if ((client.State.Equals(ClientState.PreAuth) || (ircd.Config.Value.Advanced.ResolveHostnames && client.ResolvingHost)) && !registrationCommands.Contains(packet.ToUpper())) { |
Member
There was a problem hiding this comment.
We might be able to inject specific configs info PacketManager soon anyway. No problem with this.
| HashAlgorithm algorithm; | ||
| if(!_algorithms.TryGetValue(ircop.Algorithm, out algorithm)) | ||
| algorithm = _algorithms[ircop.Algorithm] = (ircop.Algorithm.GetConstructor(Type.EmptyTypes)?.Invoke(new object[0]) as HashAlgorithm) ?? throw new IrcErrNoOperHostException(client); | ||
| if(!_algorithms.TryGetValue(ircop.AlgorithmType, out algorithm)) |
Member
There was a problem hiding this comment.
Sorry about this part. We'll figure something out.
We should test server linking is still working.
joshoxe
commented
May 23, 2021
…ub.com/cmpct/cmpctircd into feature/IRCD-59-decouple-configuration
joshoxe
commented
May 23, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.