Method: Spaceship::ConnectAPI::Profile#valid?

Defined in:
spaceship/lib/spaceship/connect_api/models/profile.rb

#valid?Boolean

Returns:

  • (Boolean)


66
67
68
69
70
71
72
73
74
75
# File 'spaceship/lib/spaceship/connect_api/models/profile.rb', line 66

def valid?
  # Provisioning profiles are not invalidated automatically on the dev portal when the certificate expires.
  # They become Invalid only when opened directly in the portal 🤷.
  # We need to do an extra check on the expiration date to ensure the profile is valid.
  expired = Time.now.utc > Time.parse(self.expiration_date)

  is_valid = profile_state == ProfileState::ACTIVE && !expired

  return is_valid
end