Skip to content

Commit

Permalink
Project info text and URL made configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Shreyas Shivakumara committed Sep 21, 2023
1 parent 0b8ea90 commit d68ea0a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions charts/sda-svc/templates/auth-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ spec:
{{- end }}
- name: S3INBOX
value: {{ .Values.global.ingress.hostName.s3Inbox }}
- name: INFOTEXT
value: {{ .Values.global.auth.infoText }}
- name: INFOURL
value: {{ .Values.global.auth.inforURL }}
ports:
- name: auth
containerPort: 8080
Expand Down
4 changes: 4 additions & 0 deletions charts/sda-svc/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ global:
corsMethods: ""
# @param corsCreds, allow credentials in the request, cors is disabled if false
corsCreds: false
# @param infoText, name of the project
infoText:
# @param inforURL, URL of the project
inforURL:

broker:
durable: true
Expand Down
4 changes: 4 additions & 0 deletions sda-auth/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ type Config struct {
Server ServerConfig
S3Inbox string
ResignJwt bool
InfoURL string
InfoText string
}

// NewConfig initializes and parses the config file and/or environment using
Expand Down Expand Up @@ -90,6 +92,8 @@ func (c *Config) readConfig() error {
c.JwtPrivateKey = viper.GetString("JwtPrivateKey")
c.JwtSignatureAlg = viper.GetString("JwtSignatureAlg")
c.JwtIssuer = viper.GetString("jwtIssuer")
c.InfoURL = viper.GetString("infoUrl")
c.InfoText = viper.GetString("infoText")

viper.SetDefault("ResignJwt", true)
c.ResignJwt = viper.GetBool("resignJwt")
Expand Down
2 changes: 2 additions & 0 deletions sda-auth/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ jwtIssuer: "http://auth:8080"
jwtPrivateKey: "keys/sign-jwt.key"
jwtSignatureAlg: "ES256"
resignJwt: true
infoText: "About LEGA"
infoUrl: "https://elixir-europe.org/internal-projects/staff-exchange-programme/localfederated-ega"
2 changes: 1 addition & 1 deletion sda-auth/frontend/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<a class="nav-link" href="/">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://elixir-europe.org/about-us/staff-exchange-programme/localfederated-ega">About LocalEGA</a>
<a class="nav-link" href="{{.infoUrl}}">{{.infoText}}</a>
</li>
</ul>
</div>
Expand Down
2 changes: 2 additions & 0 deletions sda-auth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ func (auth AuthHandler) getInboxConfig(ctx iris.Context, authType string) {
// getMain returns the index.html page
func (auth AuthHandler) getMain(ctx iris.Context) {

ctx.ViewData("infoUrl", auth.Config.InfoURL)
ctx.ViewData("infoText", auth.Config.InfoText)
err := ctx.View("index.html")
if err != nil {
log.Error("Failed to view index page: ", err)
Expand Down

0 comments on commit d68ea0a

Please sign in to comment.