-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
feat: Support to ory hydra running in secure mode #62
Merged
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
6491a99
Support to ory hydra running in secure mode
fjvierap d769f7d
feat: adjust readme
fjvierap daf5c44
Add namespace bases roles instead of cluster
fjvierap 7d66a70
Add log message when enable insecure skip verify
fjvierap d90f5a9
Add setup log for insecure verify
fjvierap 509ee6a
Adjust README.md
fjvierap 90f8234
Merge remote-tracking branch 'origin/master' into namespace
fjvierap 715ee4a
Add error for not existent tls trust store
fjvierap 51a4e30
Merge pull request #1 from fjvierap/namespace
fjvierap e16c267
Adjust rbac
fjvierap b75d417
Add unit test for create http client
fjvierap 5364f44
Remove HydraClientMaker
fjvierap d403834
Improve error handling
fjvierap d12ad0a
Add helpers to makefile for testing that package
fjvierap 9b8f463
build: update CRDs and k8s dependencies (#68)
colunira 9d56503
docs: Incorporates changes from version v0.0.20
14611a8
Support to ory hydra running in secure mode
fjvierap 7f2bf13
feat: adjust readme
fjvierap cde714e
Add namespace bases roles instead of cluster
fjvierap bbd2830
Add log message when enable insecure skip verify
fjvierap a210259
Add setup log for insecure verify
fjvierap 00d3a80
Adjust README.md
fjvierap 1ff476c
Add error for not existent tls trust store
fjvierap b8622e0
Adjust rbac
fjvierap ba61fce
Add unit test for create http client
fjvierap 9c5a153
Remove HydraClientMaker
fjvierap 27558c3
Improve error handling
fjvierap aaf8870
Add helpers to makefile for testing that package
fjvierap 80230cd
Merge branch 'master' of https://github.com/fjvierap/hydra-maester
fjvierap File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,47 @@ | ||
package helpers | ||
package helpers_test | ||
|
||
import ( | ||
"io/ioutil" | ||
"os" | ||
"testing" | ||
|
||
"github.com/ory/hydra-maester/helpers" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestCreateHttpClient(t *testing.T) { | ||
t.Run("should create insecureSkipVerify client", func(t *testing.T) { | ||
client := CreateHttpClient(true, "") | ||
client, err := helpers.CreateHttpClient(true, "") | ||
require.NotNil(t, client) | ||
require.Nil(t, err) | ||
}) | ||
|
||
t.Run("should create client with insecureSkipVerify and wrong tlsTrustStore", func(t *testing.T) { | ||
tlsTrustStore := "some path" | ||
client := CreateHttpClient(true, tlsTrustStore) | ||
client, err := helpers.CreateHttpClient(true, tlsTrustStore) | ||
require.Nil(t, client) | ||
require.Nil(t, err) | ||
}) | ||
|
||
t.Run("should create client with and tlsTrustStore", func(t *testing.T) { | ||
file, err := ioutil.TempFile("/tmp", "test") | ||
require.Nil(t, err) | ||
client := CreateHttpClient(true, file.Name()) | ||
client, err := helpers.CreateHttpClient(true, file.Name()) | ||
defer os.Remove(file.Name()) | ||
require.NotNil(t, client) | ||
require.Nil(t, err) | ||
}) | ||
|
||
t.Run("should not create client with and wrong tlsTrustStore", func(t *testing.T) { | ||
client, err := helpers.CreateHttpClient(true, "/somefile") | ||
require.NotNil(t, client) | ||
require.NotNil(t, err) | ||
}) | ||
|
||
t.Run("should create client without and tlsTrustStore", func(t *testing.T) { | ||
client := CreateHttpClient(true, "") | ||
client, err := helpers.CreateHttpClient(true, "") | ||
require.NotNil(t, client) | ||
require.Nil(t, err) | ||
}) | ||
} |
This file contains 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
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.
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.
Since we control what error will be returned here, maybe we could check not only if the err is not nil, but if it the one we expect?