Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
dex
Commits
7288e49c
Commit
7288e49c
authored
Oct 14, 2016
by
Eric Chiang
Committed by
GitHub
Oct 14, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #610 from ericchiang/dev-fix-linting
dev branch: fix linting
parents
e7d7c350
96440e4c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
Makefile
Makefile
+1
-1
handlers_test.go
server/handlers_test.go
+1
-1
server_test.go
server/server_test.go
+6
-6
No files found.
Makefile
View file @
7288e49c
...
@@ -54,7 +54,7 @@ fmt:
...
@@ -54,7 +54,7 @@ fmt:
lint
:
lint
:
@
for
package
in
$(
shell
go list ./... |
grep
-v
'/vendor/'
|
grep
-v
'/api'
)
;
do
\
@
for
package
in
$(
shell
go list ./... |
grep
-v
'/vendor/'
|
grep
-v
'/api'
)
;
do
\
golint
-set_exit_status
$$
package
;
\
golint
-set_exit_status
$$
package
$$
i
||
exit
1
;
\
done
done
server/templates_default.go
:
$(wildcard web/templates/**)
server/templates_default.go
:
$(wildcard web/templates/**)
...
...
server/handlers_test.go
View file @
7288e49c
...
@@ -12,7 +12,7 @@ func TestHandleHealth(t *testing.T) {
...
@@ -12,7 +12,7 @@ func TestHandleHealth(t *testing.T) {
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
defer
cancel
()
defer
cancel
()
httpServer
,
server
:=
newTestServer
(
t
,
ctx
,
nil
)
httpServer
,
server
:=
newTestServer
(
ctx
,
t
,
nil
)
defer
httpServer
.
Close
()
defer
httpServer
.
Close
()
rr
:=
httptest
.
NewRecorder
()
rr
:=
httptest
.
NewRecorder
()
...
...
server/server_test.go
View file @
7288e49c
...
@@ -69,7 +69,7 @@ FDWV28nTP9sqbtsmU8Tem2jzMvZ7C/Q0AuDoKELFUpux8shm8wfIhyaPnXUGZoAZ
...
@@ -69,7 +69,7 @@ FDWV28nTP9sqbtsmU8Tem2jzMvZ7C/Q0AuDoKELFUpux8shm8wfIhyaPnXUGZoAZ
Np4vUwMSYV5mopESLWOg3loBxKyLGFtgGKVCjGiQvy6zISQ4fQo=
Np4vUwMSYV5mopESLWOg3loBxKyLGFtgGKVCjGiQvy6zISQ4fQo=
-----END RSA PRIVATE KEY-----`
)
-----END RSA PRIVATE KEY-----`
)
func
newTestServer
(
t
*
testing
.
T
,
ctx
context
.
Context
,
updateConfig
func
(
c
*
Config
))
(
*
httptest
.
Server
,
*
Server
)
{
func
newTestServer
(
ctx
context
.
Context
,
t
*
testing
.
T
,
updateConfig
func
(
c
*
Config
))
(
*
httptest
.
Server
,
*
Server
)
{
var
server
*
Server
var
server
*
Server
s
:=
httptest
.
NewServer
(
http
.
HandlerFunc
(
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
s
:=
httptest
.
NewServer
(
http
.
HandlerFunc
(
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
server
.
ServeHTTP
(
w
,
r
)
server
.
ServeHTTP
(
w
,
r
)
...
@@ -101,14 +101,14 @@ func newTestServer(t *testing.T, ctx context.Context, updateConfig func(c *Confi
...
@@ -101,14 +101,14 @@ func newTestServer(t *testing.T, ctx context.Context, updateConfig func(c *Confi
func
TestNewTestServer
(
t
*
testing
.
T
)
{
func
TestNewTestServer
(
t
*
testing
.
T
)
{
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
defer
cancel
()
defer
cancel
()
newTestServer
(
t
,
ctx
,
nil
)
newTestServer
(
ctx
,
t
,
nil
)
}
}
func
TestDiscovery
(
t
*
testing
.
T
)
{
func
TestDiscovery
(
t
*
testing
.
T
)
{
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
defer
cancel
()
defer
cancel
()
httpServer
,
_
:=
newTestServer
(
t
,
ctx
,
func
(
c
*
Config
)
{
httpServer
,
_
:=
newTestServer
(
ctx
,
t
,
func
(
c
*
Config
)
{
c
.
Issuer
=
c
.
Issuer
+
"/non-root-path"
c
.
Issuer
=
c
.
Issuer
+
"/non-root-path"
})
})
defer
httpServer
.
Close
()
defer
httpServer
.
Close
()
...
@@ -257,7 +257,7 @@ func TestOAuth2CodeFlow(t *testing.T) {
...
@@ -257,7 +257,7 @@ func TestOAuth2CodeFlow(t *testing.T) {
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
defer
cancel
()
defer
cancel
()
httpServer
,
s
:=
newTestServer
(
t
,
ctx
,
func
(
c
*
Config
)
{
httpServer
,
s
:=
newTestServer
(
ctx
,
t
,
func
(
c
*
Config
)
{
c
.
Issuer
=
c
.
Issuer
+
"/non-root-path"
c
.
Issuer
=
c
.
Issuer
+
"/non-root-path"
})
})
defer
httpServer
.
Close
()
defer
httpServer
.
Close
()
...
@@ -370,7 +370,7 @@ func TestOAuth2ImplicitFlow(t *testing.T) {
...
@@ -370,7 +370,7 @@ func TestOAuth2ImplicitFlow(t *testing.T) {
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
defer
cancel
()
defer
cancel
()
httpServer
,
s
:=
newTestServer
(
t
,
ctx
,
func
(
c
*
Config
)
{
httpServer
,
s
:=
newTestServer
(
ctx
,
t
,
func
(
c
*
Config
)
{
// Enable support for the implicit flow.
// Enable support for the implicit flow.
c
.
SupportedResponseTypes
=
[]
string
{
"code"
,
"token"
}
c
.
SupportedResponseTypes
=
[]
string
{
"code"
,
"token"
}
})
})
...
@@ -500,7 +500,7 @@ func TestCrossClientScopes(t *testing.T) {
...
@@ -500,7 +500,7 @@ func TestCrossClientScopes(t *testing.T) {
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
defer
cancel
()
defer
cancel
()
httpServer
,
s
:=
newTestServer
(
t
,
ctx
,
func
(
c
*
Config
)
{
httpServer
,
s
:=
newTestServer
(
ctx
,
t
,
func
(
c
*
Config
)
{
c
.
Issuer
=
c
.
Issuer
+
"/non-root-path"
c
.
Issuer
=
c
.
Issuer
+
"/non-root-path"
})
})
defer
httpServer
.
Close
()
defer
httpServer
.
Close
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment