Skip to content

Commit

Permalink
Refactor Oidc to OIDC
Browse files Browse the repository at this point in the history
  • Loading branch information
Fredrik Dyrvold committed Dec 3, 2021
1 parent 179fde8 commit 768f39f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func main() {
healthModule{}.Register(r.Group("/api"))

if config.HTTP.OIDC.Enable {
rsaKeys := GetOidcPublicKeys(config.HTTP.OIDC)
rsaKeys := GetOIDCPublicKeys(config.HTTP.OIDC)
r.Use(VerifyTokenMiddleware(config.HTTP.OIDC, rsaKeys))
SubscribeToKeyURLUpdates(config.HTTP.OIDC, rsaKeys)
}
Expand Down
6 changes: 3 additions & 3 deletions oidc_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import (
// See the License for the specific language governing permissions and
// limitations under the License.

// GetOidcPublicKeys return the public keys of the currently set WHARF_HTTP_OIDC_KeysURL.
func GetOidcPublicKeys(config OIDCConfig) *map[string]*rsa.PublicKey {
// GetOIDCPublicKeys return the public keys of the currently set WHARF_HTTP_OIDC_KeysURL.
func GetOIDCPublicKeys(config OIDCConfig) *map[string]*rsa.PublicKey {
rsaKeys := make(map[string]*rsa.PublicKey)
var body map[string]interface{}
resp, err := http.Get(config.KeysURL)
Expand Down Expand Up @@ -105,7 +105,7 @@ func SubscribeToKeyURLUpdates(config OIDCConfig, rsakeys *map[string]*rsa.Public
go func() {
for {
<-fetchOidcKeysTicker.C
rsakeys = GetOidcPublicKeys(config)
rsakeys = GetOIDCPublicKeys(config)
}
}()
}

0 comments on commit 768f39f

Please sign in to comment.