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
e8f347a7
Commit
e8f347a7
authored
Sep 25, 2015
by
Joe Bowers
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #133 from joeatwork/stricter-url-endpoints
server: user management endpoints strictly conform to schema
parents
97041dbd
4c9bab08
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
server.go
server/server.go
+1
-1
user.go
server/user.go
+5
-3
No files found.
server/server.go
View file @
e8f347a7
...
...
@@ -244,7 +244,7 @@ func (s *Server) HTTPHandler() http.Handler {
mux
.
Handle
(
path
.
Join
(
apiBasePath
,
clientPath
),
s
.
NewClientTokenAuthHandler
(
clientHandler
))
usersAPI
:=
usersapi
.
NewUsersAPI
(
s
.
UserManager
,
s
.
ClientIdentityRepo
,
s
.
UserEmailer
,
s
.
localConnectorID
)
mux
.
Handle
(
path
.
Join
(
apiBasePath
,
UsersSubTree
)
+
"/"
,
NewUserMgmtServer
(
usersAPI
,
s
.
JWTVerifierFactory
(),
s
.
UserManager
,
s
.
ClientIdentityRepo
)
.
HTTPHandler
())
mux
.
Handle
(
path
.
Join
(
apiBasePath
,
UsersSubTree
),
NewUserMgmtServer
(
usersAPI
,
s
.
JWTVerifierFactory
(),
s
.
UserManager
,
s
.
ClientIdentityRepo
)
.
HTTPHandler
())
return
http
.
Handler
(
mux
)
}
...
...
server/user.go
View file @
e8f347a7
...
...
@@ -24,8 +24,8 @@ const (
var
(
UsersSubTree
=
"/users"
UsersListEndpoint
=
addBasePath
(
UsersSubTree
)
+
"/"
UsersCreateEnd
o
oint
=
addBasePath
(
UsersSubTree
)
UsersListEndpoint
=
addBasePath
(
UsersSubTree
)
UsersCreateEnd
p
oint
=
addBasePath
(
UsersSubTree
)
UsersGetEndpoint
=
addBasePath
(
UsersSubTree
+
"/:id"
)
)
...
...
@@ -47,8 +47,10 @@ func NewUserMgmtServer(userMgmtAPI *api.UsersAPI, jwtvFactory JWTVerifierFactory
func
(
s
*
UserMgmtServer
)
HTTPHandler
()
http
.
Handler
{
r
:=
httprouter
.
New
()
r
.
RedirectTrailingSlash
=
false
r
.
RedirectFixedPath
=
false
r
.
GET
(
UsersListEndpoint
,
s
.
listUsers
)
r
.
POST
(
UsersCreateEnd
o
oint
,
s
.
createUser
)
r
.
POST
(
UsersCreateEnd
p
oint
,
s
.
createUser
)
r
.
GET
(
UsersGetEndpoint
,
s
.
getUser
)
return
r
}
...
...
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