X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=capifcore%2Finternal%2Finvokermanagementapi%2Ftypevalidation.go;h=10db3380ba8d38cf97257800e8677fd582b70381;hb=a98d361fe90ebac93c13a599529c4b743e11ace2;hp=be29481bba455eec6a24b1f048ec86d0e9539bc7;hpb=4e2b0618206193e13ba73831b6d6cb866e1d1dae;p=nonrtric%2Fplt%2Fsme.git diff --git a/capifcore/internal/invokermanagementapi/typevalidation.go b/capifcore/internal/invokermanagementapi/typevalidation.go index be29481..10db338 100644 --- a/capifcore/internal/invokermanagementapi/typevalidation.go +++ b/capifcore/internal/invokermanagementapi/typevalidation.go @@ -41,3 +41,10 @@ func (ied *APIInvokerEnrolmentDetails) Validate() error { return nil } + +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 +}