use identifier-registration.yaml as template

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
Jörn Friedrich Dreyer
2020-12-22 15:09:22 +00:00
parent af9900cefd
commit ff42549897
3 changed files with 114 additions and 114 deletions

View File

@@ -7,15 +7,11 @@ clients:
trusted: yes
insecure: yes
redirect_uris:
- https://localhost:9200/
- https://localhost:9200/oidc-callback.html
- https://localhost:9200/oidc-silent-redirect.html
- http://localhost:9100/
- http://localhost:9100/oidc-callback.html
- http://localhost:9100/oidc-silent-redirect.html
- {{OCIS_URL}}/
- {{OCIS_URL}}/oidc-callback.html
- {{OCIS_URL}}/oidc-silent-redirect.html
origins:
- https://localhost:9200
- http://localhost:9100
- {{OCIS_URL}}
- id: ocis-explorer.js
name: oCIS Graph Explorer

File diff suppressed because one or more lines are too long

View File

@@ -7,6 +7,7 @@ import (
"io/ioutil"
"net/http"
"os"
"strings"
"github.com/go-chi/chi"
"github.com/gorilla/mux"
@@ -41,7 +42,7 @@ func NewService(opts ...Option) Service {
logger.Fatal().Err(err).Msg("could not initialize env vars")
}
if err := createConfigsIfNotExist(assetVFS); err != nil {
if err := createConfigsIfNotExist(assetVFS, options.Config.Konnectd.Iss); err != nil {
logger.Fatal().Err(err).Msg("could not create default config")
}
@@ -68,7 +69,7 @@ func NewService(opts ...Option) Service {
return svc
}
func createConfigsIfNotExist(assets http.FileSystem) error {
func createConfigsIfNotExist(assets http.FileSystem, ocisURL string) error {
if _, err := os.Stat("./config"); os.IsNotExist(err) {
if err := os.Mkdir("./config", 0700); err != nil {
return err
@@ -95,6 +96,9 @@ func createConfigsIfNotExist(assets http.FileSystem) error {
return err
}
// TODO replace placeholder {{OCIS_URL}} with https://localhost:9200 / correct host
conf = []byte(strings.ReplaceAll(string(conf), "{{OCIS_URL}}", ocisURL))
err = ioutil.WriteFile("./config/identifier-registration.yaml", conf, 0600)
if err != nil {
return err