Skip to content

Commit 662270c

Browse files
committed
Fix insecure flag
1 parent e068787 commit 662270c

File tree

5 files changed

+51
-5
lines changed

5 files changed

+51
-5
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## Jira task - PUT_JIRA_LINK_HERE
2+
3+
## BREAKING CHANGE - remove this line if your code doesn't introduce a breaking change
4+
5+
## Release Notes Description (public)
6+
7+
<!--- DESCRIPTION USED IN THE RELEASE NOTES
8+
9+
Remove this comment and replace it with the description of your changes for an external audience.
10+
This description will be pulled into public release notes.
11+
12+
1. What changes are you introducing? Be clear and provide a detailed overview of your changes.
13+
2. Why are you introducing the changes? Make the intent of the changes clear.
14+
- What do those changes mean for our end users?
15+
- Why should they care?
16+
- What is the context of your changes?
17+
18+
Additionally:
19+
20+
- If your changes are breaking changes, provide information on how the change affects our customers and what is required from them to be updated.
21+
If you think a migration guide would be useful, let TWs know in advance.
22+
- If your changes deprecate an API, provide what is the alternative for our customers (if it exists). State clearly that an API became deprecated.
23+
-->
24+
25+
## Implementation details (internal)
26+
27+
<!--- Describe technical implementation details for peer reviewers -->
28+
29+
## Information for QA
30+
31+
<!-- [Place an '[X]' (no spaces) in all applicable fields.] -->
32+
33+
- [ ] Is QA testing required?
34+
- [ ] Does PR contain unit tests?
35+
- [ ] Should QA create E2E tests for the change?
36+
37+
## Additional QA Procedures (Optional)
38+
39+
<!--- Describe what QA needs to do if needed -->
40+
41+
## Screenshots (if appropriate):

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,6 @@ oauth2c https://oauth2c.us.authz.cloudentity.io/oauth2c/demo \
142142
--assertion '{"sub":"[email protected]"}'
143143
```
144144

145-
> --signing-key can be also a local file. You can use https://mkjwk.org/ to generate it
146-
> remember to public part of the key in the client jwks
147-
148145
## Auth methods
149146

150147
### Client Secret Basic

cmd/oauth2.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"github.com/cloudentity/oauth2c/internal/oauth2"
1515
"github.com/go-jose/go-jose/v3"
1616
"github.com/golang-jwt/jwt"
17+
"github.com/imdario/mergo"
1718
"github.com/pkg/browser"
1819
"github.com/pterm/pterm"
1920
"github.com/spf13/cobra"
@@ -60,7 +61,10 @@ var OAuth2Cmd = &cobra.Command{
6061
os.Exit(1)
6162
}
6263

63-
cconfig = config.ToClientConfig()
64+
if err := mergo.Merge(&cconfig, config.ToClientConfig()); err != nil {
65+
pterm.Error.PrintOnError(err)
66+
os.Exit(1)
67+
}
6468
} else {
6569
cconfig.IssuerURL = strings.TrimSuffix(args[0], oauth2.OpenIDConfigurationPath)
6670
}
@@ -178,7 +182,7 @@ func Authorize(clientConfig oauth2.ClientConfig, hc *http.Client) error {
178182
clientConfig.IssuerURL,
179183
hc,
180184
); err != nil {
181-
LogRequestAndResponseln(serverRequest, err)
185+
LogRequestln(serverRequest)
182186
return err
183187
}
184188

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ go 1.18
55
require (
66
github.com/go-jose/go-jose/v3 v3.0.0
77
github.com/golang-jwt/jwt v3.2.2+incompatible
8+
github.com/imdario/mergo v0.3.13
89
github.com/lithammer/shortuuid/v4 v4.0.0
910
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
1011
github.com/pkg/errors v0.9.1

go.sum

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+
2828
github.com/gookit/color v1.4.2/go.mod h1:fqRyamkC1W8uxl+lxCQxOT09l/vYfZ+QeiX3rKQHCoQ=
2929
github.com/gookit/color v1.5.0 h1:1Opow3+BWDwqor78DcJkJCIwnkviFi+rrOANki9BUFw=
3030
github.com/gookit/color v1.5.0/go.mod h1:43aQb+Zerm/BWh2GnrgOQm7ffz7tvQXEKV6BFMl7wAo=
31+
github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk=
32+
github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg=
3133
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
3234
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
3335
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
@@ -113,5 +115,6 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
113115
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
114116
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
115117
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
118+
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
116119
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
117120
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 commit comments

Comments
 (0)