X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=capifcore%2Finternal%2Finvokermanagementapi%2Ftypevalidation.go;h=10db3380ba8d38cf97257800e8677fd582b70381;hb=bf237808ac109b30461a453c59ff4e9cc9b297f4;hp=8bfb7846902963fce1875fd430e30f99257e836c;hpb=e499f63287a0786ed1fb94f5bf2cce09422c518f;p=nonrtric%2Fplt%2Fsme.git diff --git a/capifcore/internal/invokermanagementapi/typevalidation.go b/capifcore/internal/invokermanagementapi/typevalidation.go index 8bfb784..10db338 100644 --- a/capifcore/internal/invokermanagementapi/typevalidation.go +++ b/capifcore/internal/invokermanagementapi/typevalidation.go @@ -42,6 +42,9 @@ func (ied *APIInvokerEnrolmentDetails) Validate() error { return nil } -func (ied *APIInvokerEnrolmentDetails) IsOnboarded(otherInvoker APIInvokerEnrolmentDetails) bool { - return ied.OnboardingInformation.ApiInvokerPublicKey == otherInvoker.OnboardingInformation.ApiInvokerPublicKey +func (ied *APIInvokerEnrolmentDetails) ValidateAlreadyOnboarded(otherInvoker APIInvokerEnrolmentDetails) error { + if ied.OnboardingInformation.ApiInvokerPublicKey == otherInvoker.OnboardingInformation.ApiInvokerPublicKey { + return errors.New("invoker with identical public key already onboarded") + } + return nil }