()
| 69 | } |
| 70 | |
| 71 | func appConfig() (*extraConfig, error) { |
| 72 | configURL := os.Getenv("CAMLI_APP_CONFIG_URL") |
| 73 | if configURL == "" { |
| 74 | logf("CAMLI_APP_CONFIG_URL not defined, the app will run without any auth") |
| 75 | return nil, nil |
| 76 | } |
| 77 | cl, err := app.Client() |
| 78 | if err != nil { |
| 79 | return nil, fmt.Errorf("could not get a client to fetch extra config: %v", err) |
| 80 | } |
| 81 | conf := &extraConfig{} |
| 82 | if err := cl.GetJSON(context.Background(), configURL, conf); err != nil { |
| 83 | return nil, fmt.Errorf("could not get app extra config at %v: %v", configURL, err) |
| 84 | } |
| 85 | return conf, nil |
| 86 | } |
| 87 | |
| 88 | type handler struct { |
| 89 | httpsCert string |
no test coverage detected