Added isSecure field in the winrm settings. When isSecure is true, we allow HTTPs connection to end point powershell. If isSecure is false, we allow HTTP connection to end point powershell.#5
Open
aspiremore wants to merge 10 commits intoCiscoM31:masterfrom
Conversation
rabadin
reviewed
Dec 12, 2022
rabadin
left a comment
There was a problem hiding this comment.
I see there isn't a ton of tests in this repo... but how about adding one for your change?
winrm.go
Outdated
| NTLM | ||
| Kerberos | ||
| ) | ||
| const WINRM_HTTP_PORT = 5985 |
There was a problem hiding this comment.
It's a detail but this is unused... so I'm wondering why you're adding it.
winrm.go
Outdated
| operationTimeout string | ||
| // Timeout of each HTTP call made | ||
| timeout int | ||
| //Whether the call is http or https |
There was a problem hiding this comment.
Nits:
- Missing space before "Whether"
- http -> HTTP / https -> HTTPS
| client.winrmSettings = o(client.winrmSettings) | ||
| } | ||
| client.url = fmt.Sprintf("https://%s:%d/wsman", client.ipAddress, client.port) | ||
| if client.isSecure { |
There was a problem hiding this comment.
It's a detail but to avoid repeating the whole Sprintf line, how about:
if client.isSecure {
protocol = "https"
} else {
protocol = "http"
}
then use protocol
rabadin
reviewed
Jan 4, 2023
| Kerberos | ||
| ) | ||
| const ( | ||
| HTTP_PROTOCOL = "http" |
There was a problem hiding this comment.
This is a detail but http/https is usually referred as the "scheme".
rabadin
reviewed
Jan 4, 2023
| } | ||
| } | ||
|
|
||
| func BenchmarkHTTPRequest(b *testing.B) { |
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.