Skip to content

Commit

Permalink
include client id in openid config for frontend
Browse files Browse the repository at this point in the history
... if OIDC is enabled.
  • Loading branch information
etiennedi committed Jul 12, 2019
1 parent 12cbb90 commit 294abcc
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion adapters/handlers/rest/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Decentralised Knowledge Graph
https
Host: localhost
BasePath: /weaviate/v1
Version: 0.16.1
Version: 0.16.2
Contact: Weaviate<hello@semi.technology> https://github.com/semi-technologies
Consumes:
Expand Down
12 changes: 10 additions & 2 deletions adapters/handlers/rest/embedded_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func init() {
"url": "https://github.com/semi-technologies",
"email": "hello@semi.technology"
},
"version": "0.16.1"
"version": "0.16.2"
},
"basePath": "/weaviate/v1",
"paths": {
Expand All @@ -66,6 +66,10 @@ func init() {
"schema": {
"type": "object",
"properties": {
"clientId": {
"description": "OAuth Client ID",
"type": "string"
},
"href": {
"description": "The Location to redirect to",
"type": "string"
Expand Down Expand Up @@ -3157,7 +3161,7 @@ func init() {
"url": "https://github.com/semi-technologies",
"email": "hello@semi.technology"
},
"version": "0.16.1"
"version": "0.16.2"
},
"basePath": "/weaviate/v1",
"paths": {
Expand All @@ -3176,6 +3180,10 @@ func init() {
"schema": {
"type": "object",
"properties": {
"clientId": {
"description": "OAuth Client ID",
"type": "string"
},
"href": {
"description": "The Location to redirect to",
"type": "string"
Expand Down
8 changes: 7 additions & 1 deletion adapters/handlers/rest/handlers_misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ func setupMiscHandlers(api *operations.WeaviateAPI, requestsLog *telemetry.Reque
}

target := fmt.Sprintf("%s/.well-known/openid-configuration", serverConfig.Config.Authentication.OIDC.Issuer)
return operations.NewGetWellKnownOpenidConfigurationOK().WithPayload(&operations.GetWellKnownOpenidConfigurationOKBody{Href: target})
clientID := serverConfig.Config.Authentication.OIDC.ClientID
body := &operations.GetWellKnownOpenidConfigurationOKBody{
Href: target,
ClientID: clientID,
}

return operations.NewGetWellKnownOpenidConfigurationOK().WithPayload(body)
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ func (o *GetWellKnownOpenidConfiguration) ServeHTTP(rw http.ResponseWriter, r *h
// swagger:model GetWellKnownOpenidConfigurationOKBody
type GetWellKnownOpenidConfigurationOKBody struct {

// OAuth Client ID
ClientID string `json:"clientId,omitempty"`

// The Location to redirect to
Href string `json:"href,omitempty"`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ swagger:model GetWellKnownOpenidConfigurationOKBody
*/
type GetWellKnownOpenidConfigurationOKBody struct {

// OAuth Client ID
ClientID string `json:"clientId,omitempty"`

// The Location to redirect to
Href string `json:"href,omitempty"`
}
Expand Down
6 changes: 5 additions & 1 deletion openapi-specs/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@
},
"description": "Decentralised Knowledge Graph",
"title": "Weaviate - Decentralised Knowledge Graph",
"version": "0.16.1"
"version": "0.16.2"
},
"parameters": {
"CommonLimitParameterQuery": {
Expand Down Expand Up @@ -2826,6 +2826,10 @@
"href": {
"description": "The Location to redirect to",
"type": "string"
},
"clientId": {
"description": "OAuth Client ID",
"type": "string"
}
}
}
Expand Down

0 comments on commit 294abcc

Please sign in to comment.