Skip to content

Commit

Permalink
Cleanup tests and compilation after the code rebase.
Browse files Browse the repository at this point in the history
  • Loading branch information
bbockelm committed Oct 6, 2023
1 parent 8c2a4cc commit 6a98012
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion client/handle_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import (
"github.com/vbauerster/mpb/v8/decor"

"github.com/pelicanplatform/pelican/config"
namespaces "github.com/pelicanplatform/pelican/namespaces"
"github.com/pelicanplatform/pelican/namespaces"
"github.com/pelicanplatform/pelican/param"
)

Expand Down
1 change: 1 addition & 0 deletions origin_ui/advertise.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"net/url"
"time"

"github.com/pelicanplatform/pelican/client"
"github.com/pelicanplatform/pelican/config"
"github.com/pelicanplatform/pelican/director"
"github.com/pelicanplatform/pelican/param"
Expand Down
4 changes: 2 additions & 2 deletions web_ui/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ func checkPromToken(av1 *route.Router) gin.HandlerFunc {
c.JSON(400, gin.H{"error": "Failed to parse token"})
}

fedURL := viper.GetString("FederationURL")
fedURL := param.Federation_DiscoveryUrl.GetString()

var bKey *jwk.Key
if fedURL == token.Issuer() {
err := pelican_config.DiscoverFederation()
if err != nil {
c.JSON(400, gin.H{"error": "Failed to discover the federation information"})
}
fedURIFile := viper.GetString("FederationURI")
fedURIFile := param.Federation_DiscoveryUrl.GetString()
response, err := http.Get(fedURIFile)
if err != nil {
c.JSON(400, gin.H{"error": "Failed to get federation key file"})
Expand Down
8 changes: 4 additions & 4 deletions web_ui/prometheus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"github.com/lestrrat-go/jwx/v2/jwk"
"github.com/lestrrat-go/jwx/v2/jwt"
"github.com/pelicanplatform/pelican/config"
"github.com/pelicanplatform/pelican/param"
"github.com/prometheus/common/route"
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
)

Expand Down Expand Up @@ -49,7 +49,7 @@ func TestPrometheusProtectionFederationURL(t *testing.T) {
c, r := gin.CreateTestContext(w)
// Note, this handler function intercepts the "http.Get call to the federation uri
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
issuerKeyFile := viper.GetString("IssuerKey")
issuerKeyFile := param.IssuerKey.GetString()
contents, err := os.ReadFile(issuerKeyFile)
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -101,7 +101,7 @@ func TestPrometheusProtectionFederationURL(t *testing.T) {
}
jti := base64.RawURLEncoding.EncodeToString(jti_bytes)

originUrl := viper.GetString("OriginURL")
originUrl := param.Origin_Url.GetString
tok, err := jwt.NewBuilder().
Claim("scope", "prometheus.read").
Claim("wlcg.ver", "1.0").
Expand Down Expand Up @@ -193,7 +193,7 @@ func TestPrometheusProtectionOriginHeaderScope(t *testing.T) {
}
jti := base64.RawURLEncoding.EncodeToString(jti_bytes)

originUrl := viper.GetString("OriginURL")
originUrl := param.Origin_Url.GetString
tok, err := jwt.NewBuilder().
Claim("scope", "prometheus.read").
Claim("wlcg.ver", "1.0").
Expand Down

0 comments on commit 6a98012

Please sign in to comment.