Class: Spaceship::PortalClient

Inherits:
Client
  • Object
show all
Defined in:
lib/motion-provisioning/spaceship/portal_client.rb

Direct Known Subclasses

FreePortalClient

Instance Method Summary collapse

Instance Method Details

#create_certificate!(type, csr, app_id = nil) ⇒ Object

Fix a bug in Fastlane where the slug is hardcoded to ios



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/motion-provisioning/spaceship/portal_client.rb', line 18

def create_certificate!(type, csr, app_id = nil)
  ensure_csrf(Spaceship::Certificate)

  mac = Spaceship::Portal::Certificate::MAC_CERTIFICATE_TYPE_IDS.keys.include?(type)

  r = request(:post, "account/#{platform_slug(mac)}/certificate/submitCertificateRequest.action", {
    teamId: team_id,
    type: type,
    csrContent: csr,
    appIdId: app_id # optional
  })
  parse_response(r, 'certRequest')
end

#development_certificates(mac: false) ⇒ Object



10
11
12
13
14
15
# File 'lib/motion-provisioning/spaceship/portal_client.rb', line 10

def development_certificates(mac: false)
  paging do |page_number|
    r = request(:post, "https://developerservices2.apple.com/services/#{PROTOCOL_VERSION}/#{platform_slug(mac)}/listAllDevelopmentCerts.action?clientId=XABBG36SBA&teamId=#{team_id}")
    parse_response(r, 'certificates')
  end
end

#distribution_certificates(mac: false) ⇒ Object



3
4
5
6
7
8
# File 'lib/motion-provisioning/spaceship/portal_client.rb', line 3

def distribution_certificates(mac: false)
  paging do |page_number|
    r = request(:post, "https://developerservices2.apple.com/services/#{PROTOCOL_VERSION}/#{platform_slug(mac)}/downloadDistributionCerts.action?clientId=XABBG36SBA&teamId=#{team_id}")
    parse_response(r, 'certificates')
  end
end