NONRTRIC-946: Make GET for GetApfIdServiceApis stateless
[nonrtric/plt/sme.git] / capifcore / internal / invokermanagementapi / typevalidation.go
index be29481..10db338 100644 (file)
@@ -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
+}