code: function validateUpdatedCredentialProperties (type, credentialDetails) {
    const newCredentialProperties = {};
    const credentialConfig = config.models.credentials.properties[type];
  
    for (const prop in credentialConfig.properties) {
      if (prop === 'scopes') {
        continue;
      }
      if (credentialDetails[prop]) {
        if (typeof credentialDetails[prop] !== 'string') {
          throw new Error('credential property must be a string'); // TODO: replace with validation error
        }
        if (credentialConfig.properties[prop].isMutable !== false) {
          newCredentialProperties[prop] = credentialDetails[prop];
        } else throw new Error(`${prop} is immutable`);
      }
    }
  
    return Object.keys(newCredentialProperties).length > 0 ? Promise.resolve(newCredentialProperties) : Promise.resolve(null);
  }
docs: This function validates all user defined properties, excluding scopes