[release] v0.10.4-unstable
This commit is contained in:
parent
744b98b3db
commit
3f39200214
|
@ -1,3 +1,8 @@
|
||||||
|
## Version 0.10.4
|
||||||
|
- Encode OpenID .well-known to JSON
|
||||||
|
- Fix incompatibility with other apps using .well-known
|
||||||
|
- Secure the OpenID routes that missed the hardening
|
||||||
|
|
||||||
## Version 0.10.3
|
## Version 0.10.3
|
||||||
- Add missing Constellation logs when creating certs
|
- Add missing Constellation logs when creating certs
|
||||||
- Ignore empty links in cosmos-compose
|
- Ignore empty links in cosmos-compose
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "cosmos-server",
|
"name": "cosmos-server",
|
||||||
"version": "0.10.3",
|
"version": "0.10.4-unstable",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "test-server.js",
|
"main": "test-server.js",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|
|
@ -86,8 +86,11 @@ func RegisterHandlers(wellKnown *mux.Router, userRouter *mux.Router, serverRoute
|
||||||
serverRouter.HandleFunc("/introspect", introspectionEndpoint)
|
serverRouter.HandleFunc("/introspect", introspectionEndpoint)
|
||||||
|
|
||||||
// public endpoints
|
// public endpoints
|
||||||
wellKnown.HandleFunc("/openid-configuration", discoverEndpoint)
|
// set well-known endpoints to be json encoded
|
||||||
wellKnown.HandleFunc("/jwks.json", jwksEndpoint)
|
wellKnown.Use(utils.AcceptHeader("application/json"))
|
||||||
|
|
||||||
|
wellKnown.HandleFunc("/.well-known/openid-configuration", discoverEndpoint)
|
||||||
|
wellKnown.HandleFunc("/.well-known/jwks.json", jwksEndpoint)
|
||||||
}
|
}
|
||||||
|
|
||||||
// A session is passed from the `/auth` to the `/token` endpoint. You probably want to store data like: "Who made the request",
|
// A session is passed from the `/auth` to the `/token` endpoint. You probably want to store data like: "Who made the request",
|
||||||
|
|
|
@ -68,7 +68,8 @@ func discoverEndpoint(rw http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rw.Header().Del("Content-Type")
|
||||||
|
rw.Header().Set("Content-Type", "application/json")
|
||||||
|
|
||||||
json.NewEncoder(rw).Encode(&oidcConfiguration{
|
json.NewEncoder(rw).Encode(&oidcConfiguration{
|
||||||
Issuer: hostname,
|
Issuer: hostname,
|
||||||
|
|
|
@ -35,6 +35,9 @@ func jwksEndpoint(rw http.ResponseWriter, req *http.Request) {
|
||||||
// RSA Public Key from rsa.GenerateKey
|
// RSA Public Key from rsa.GenerateKey
|
||||||
publicKey := AuthPrivateKey.Public().(*rsa.PublicKey)
|
publicKey := AuthPrivateKey.Public().(*rsa.PublicKey)
|
||||||
|
|
||||||
|
rw.Header().Del("Content-Type")
|
||||||
|
rw.Header().Set("Content-Type", "application/json")
|
||||||
|
|
||||||
json.NewEncoder(rw).Encode(&JsonWebKeySet{
|
json.NewEncoder(rw).Encode(&JsonWebKeySet{
|
||||||
Keys: []JsonWebKey{
|
Keys: []JsonWebKey{
|
||||||
{
|
{
|
||||||
|
|
|
@ -372,10 +372,10 @@ func InitServer() *mux.Router {
|
||||||
SecureAPI(userRouter, false)
|
SecureAPI(userRouter, false)
|
||||||
|
|
||||||
serverRouter := router.PathPrefix("/oauth2").Subrouter()
|
serverRouter := router.PathPrefix("/oauth2").Subrouter()
|
||||||
SecureAPI(userRouter, true)
|
SecureAPI(serverRouter, true)
|
||||||
|
|
||||||
wellKnownRouter := router.PathPrefix("/.well-known").Subrouter()
|
wellKnownRouter := router.PathPrefix("/").Subrouter()
|
||||||
SecureAPI(userRouter, true)
|
SecureAPI(wellKnownRouter, true)
|
||||||
|
|
||||||
authorizationserver.RegisterHandlers(wellKnownRouter, userRouter, serverRouter)
|
authorizationserver.RegisterHandlers(wellKnownRouter, userRouter, serverRouter)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue