X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=capifcore%2Finternal%2Fsecurityservice%2Fsecurity.go;h=4437123e49b5aef463810712e9eba0c6449fbdb6;hb=8fa464fbe92fe7fa2107915accfe93cb932fb021;hp=e211f673718e8eabbe63dcaa32453d7d493eb2b9;hpb=051a4a32068b4718ef9ddb1868e532a976de843e;p=nonrtric%2Fplt%2Fsme.git diff --git a/capifcore/internal/securityservice/security.go b/capifcore/internal/securityservice/security.go index e211f67..4437123 100644 --- a/capifcore/internal/securityservice/security.go +++ b/capifcore/internal/securityservice/security.go @@ -2,7 +2,8 @@ // ========================LICENSE_START================================= // O-RAN-SC // %% -// Copyright (C) 2022: Nordix Foundation +// Copyright (C) 2022-2023: Nordix Foundation +// Copyright (C) 2024: OpenInfra Foundation Europe // %% // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -192,11 +193,6 @@ func (s *Security) PutTrustedInvokersApiInvokerId(ctx echo.Context, apiInvokerId return sendCoreError(ctx, http.StatusBadRequest, fmt.Sprintf(errMsg, err)) } - err = s.keycloak.AddClient(apiInvokerId, "invokerrealm") - if err != nil { - return sendCoreError(ctx, http.StatusBadRequest, fmt.Sprintf(errMsg, err)) - } - uri := ctx.Request().Host + ctx.Request().URL.String() ctx.Response().Header().Set(echo.HeaderLocation, ctx.Scheme()+`://`+path.Join(uri, apiInvokerId)) @@ -245,7 +241,7 @@ func (s *Security) PostTrustedInvokersApiInvokerIdDelete(ctx echo.Context, apiIn } if ss, ok := s.trustedInvokers[apiInvokerId]; ok { - securityInfoCopy := s.revokeTrustedInvoker(&ss, notification, apiInvokerId) + securityInfoCopy := s.revokeTrustedInvoker(&ss, notification) if len(securityInfoCopy) == 0 { s.deleteTrustedInvoker(apiInvokerId) @@ -262,7 +258,7 @@ func (s *Security) PostTrustedInvokersApiInvokerIdDelete(ctx echo.Context, apiIn } -func (s *Security) revokeTrustedInvoker(ss *securityapi.ServiceSecurity, notification securityapi.SecurityNotification, apiInvokerId string) []securityapi.SecurityInformation { +func (s *Security) revokeTrustedInvoker(ss *securityapi.ServiceSecurity, notification securityapi.SecurityNotification) []securityapi.SecurityInformation { data, _ := copystructure.Copy(ss.SecurityInfo) securityInfoCopy, _ := data.([]securityapi.SecurityInformation)