Skip to content

Commit

Permalink
Fix: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
andy89923 committed Dec 12, 2023
1 parent 8a6d593 commit a2e86c1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
3 changes: 1 addition & 2 deletions internal/util/nf_authorization.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ import (

"github.com/free5gc/openapi/oauth"
udm_context "github.com/free5gc/udm/internal/context"
"github.com/free5gc/udm/pkg/factory"
)

// This function would check the OAuth2 token, and the requestNF is in ServiceAllowNfType
func AuthorizationCheck(c *gin.Context, serviceName string) error {
if factory.UdmConfig.GetOAuth() {
if udm_context.GetSelf().OAuth2Required {
oauth_err := oauth.VerifyOAuth(c.Request.Header.Get("Authorization"), serviceName,
udm_context.GetSelf().NrfCerPem)
if oauth_err != nil {
Expand Down
7 changes: 0 additions & 7 deletions pkg/factory/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,6 @@ type Sbi struct {
BindingIPv4 string `yaml:"bindingIPv4,omitempty" valid:"host,required"` // IP used to run the server in the node.
Port int `yaml:"port,omitempty" valid:"port,required"`
Tls *Tls `yaml:"tls,omitempty" valid:"optional"`
OAuth bool `yaml:"oauth,omitempty" valid:"optional"`
}

func (c *Config) GetOAuth() bool {
c.RLock()
defer c.RUnlock()
return c.Configuration.Sbi.OAuth
}

func (s *Sbi) validate() (bool, error) {
Expand Down

0 comments on commit a2e86c1

Please sign in to comment.