class SignedGlobalID

def verify_with_legacy_self_validated_metadata(sgid, options)

def verify_with_legacy_self_validated_metadata(sgid, options)
  metadata = pick_verifier(options).verify(sgid)
  raise_if_expired(metadata['expires_at'])
  metadata['gid'] if pick_purpose(options)&.to_s == metadata['purpose']&.to_s
rescue ActiveSupport::MessageVerifier::InvalidSignature, ExpiredMessage
  nil
end