Skip to content

Commit bb085da

Browse files
godreilpusoktothszabigaborszakacs
authored
Enterprise api (#365)
* Add new package * Update dependencies * New override field * Update dependencies * Fix indentation * Update dependencies * Update go-xcode * Update step input properties --------- Co-authored-by: LaszloP <7979773+lpusok@users.noreply.github.com> Co-authored-by: Szabolcs Toth <54896607+tothszabi@users.noreply.github.com> Co-authored-by: Gabor Szakacs <gabor.szakacs@bitrise.io>
1 parent 1274c93 commit bb085da

31 files changed

+274
-488
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ require (
66
github.com/bitrise-io/go-steputils/v2 v2.0.0-alpha.23
77
github.com/bitrise-io/go-utils v1.0.12
88
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23
9-
github.com/bitrise-io/go-xcode v1.1.1
10-
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.48
9+
github.com/bitrise-io/go-xcode v1.1.2-0.20241021091717-e6ebe7ad2c74
10+
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.50
1111
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
1212
github.com/stretchr/testify v1.9.0
1313
gopkg.in/yaml.v3 v3.0.1

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ github.com/bitrise-io/go-utils v1.0.12 h1:iJV1ZpyvSA0NCte/N6x+aIQ9TrNr5sIBlcJBf0
1111
github.com/bitrise-io/go-utils v1.0.12/go.mod h1:ZY1DI+fEpZuFpO9szgDeICM4QbqoWVt0RSY3tRI1heY=
1212
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23 h1:Dfh4nyZPuEtilBisidejqxBrkx9cWvbOUrpq8VEION0=
1313
github.com/bitrise-io/go-utils/v2 v2.0.0-alpha.23/go.mod h1:3XUplo0dOWc3DqT2XA2SeHToDSg7+j1y1HTHibT2H68=
14-
github.com/bitrise-io/go-xcode v1.1.1 h1:Krfa8iYZZWdLBuH7AXbufFZwL+Pys7etqvd8+Ehdwt8=
15-
github.com/bitrise-io/go-xcode v1.1.1/go.mod h1:9OwsvrhZ4A2JxHVoEY7CPcABAKA+OE7FQqFfBfvbFuY=
16-
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.48 h1:nsd41UsIGZrPy94tlFxoDCfH2I19A9buPOA/cLgucjA=
17-
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.48/go.mod h1:KpxSPrRLgY0fscSajOyO/5h7MhapsqnSJr17oXEaPsg=
14+
github.com/bitrise-io/go-xcode v1.1.2-0.20241021091717-e6ebe7ad2c74 h1:gs74s+ljimZhALk+YwquKh6xLT+wHJ4NLK8nhukFaww=
15+
github.com/bitrise-io/go-xcode v1.1.2-0.20241021091717-e6ebe7ad2c74/go.mod h1:9OwsvrhZ4A2JxHVoEY7CPcABAKA+OE7FQqFfBfvbFuY=
16+
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.50 h1:vh3miMo4lZb5fz8D1Tca0AerRv2hO3gZS4R5nEeSXKg=
17+
github.com/bitrise-io/go-xcode/v2 v2.0.0-alpha.50/go.mod h1:KpxSPrRLgY0fscSajOyO/5h7MhapsqnSJr17oXEaPsg=
1818
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1919
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
2020
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

step.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,6 @@ inputs:
422422
on a step-level. Most of the time it's easier to set up the connection on the App Settings page on Bitrise.
423423
The input value can be a file path (eg. `$TMPDIR/private_key.p8`) or an HTTPS URL.
424424
This input only takes effect if the other two connection override inputs are set too (`api_key_id`, `api_key_issuer_id`).
425-
is_required: false
426425
427426
- api_key_id:
428427
opts:
@@ -434,7 +433,6 @@ inputs:
434433
This overrides the Bitrise-managed API connection, only set this input if you want to control the API connection
435434
on a step-level. Most of the time it's easier to set up the connection on the App Settings page on Bitrise.
436435
This input only takes effect if the other two connection override inputs are set too (`api_key_path`, `api_key_issuer_id`).
437-
is_required: false
438436
439437
- api_key_issuer_id:
440438
opts:
@@ -446,7 +444,19 @@ inputs:
446444
This overrides the Bitrise-managed API connection, only set this input if you want to control the API connection
447445
on a step-level. Most of the time it's easier to set up the connection on the App Settings page on Bitrise.
448446
This input only takes effect if the other two connection override inputs are set too (`api_key_path`, `api_key_id`).
449-
is_required: false
447+
448+
- api_key_enterprise_account: "no"
449+
opts:
450+
category: App Store Connect connection override
451+
title: App Store Connect API enterprise account
452+
summary: Indicates if the account is an enterprise type. This overrides the Bitrise-managed API connection.
453+
description: |-
454+
Indicates if the account is an enterprise type.
455+
This overrides the Bitrise-managed API connection, only set this input if you know you have an enterprise account.
456+
value_options:
457+
- "yes"
458+
- "no"
459+
is_required: true
450460

451461
# Debugging
452462

step/step.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"github.com/bitrise-io/go-utils/v2/fileutil"
2222
"github.com/bitrise-io/go-utils/v2/log"
2323
"github.com/bitrise-io/go-utils/v2/pathutil"
24-
"github.com/bitrise-io/go-xcode/devportalservice"
2524
"github.com/bitrise-io/go-xcode/exportoptions"
2625
"github.com/bitrise-io/go-xcode/profileutil"
2726
"github.com/bitrise-io/go-xcode/v2/autocodesign/certdownloader"
@@ -31,6 +30,7 @@ import (
3130
"github.com/bitrise-io/go-xcode/v2/autocodesign/profiledownloader"
3231
"github.com/bitrise-io/go-xcode/v2/autocodesign/projectmanager"
3332
"github.com/bitrise-io/go-xcode/v2/codesign"
33+
"github.com/bitrise-io/go-xcode/v2/devportalservice"
3434
"github.com/bitrise-io/go-xcode/v2/exportoptionsgenerator"
3535
"github.com/bitrise-io/go-xcode/v2/xcconfig"
3636
cache "github.com/bitrise-io/go-xcode/v2/xcodecache"
@@ -104,6 +104,7 @@ type Inputs struct {
104104
APIKeyPath stepconf.Secret `env:"api_key_path"`
105105
APIKeyID string `env:"api_key_id"`
106106
APIKeyIssuerID string `env:"api_key_issuer_id"`
107+
APIKeyEnterpriseAccount bool `env:"api_key_enterprise_account,opt[yes,no]"`
107108
BuildURL string `env:"BITRISE_BUILD_URL"`
108109
BuildAPIToken stepconf.Secret `env:"BITRISE_BUILD_API_TOKEN"`
109110
}
@@ -705,7 +706,7 @@ func (s XcodebuildArchiver) createCodesignManager(config Config) (codesign.Manag
705706
return codesign.Manager{}, err
706707
}
707708

708-
devPortalClientFactory := devportalclient.NewFactory(s.logger)
709+
devPortalClientFactory := devportalclient.NewFactory(s.logger, s.fileManager)
709710

710711
var serviceConnection *devportalservice.AppleDeveloperConnection = nil
711712
if config.BuildURL != "" && config.BuildAPIToken != "" {
@@ -715,9 +716,10 @@ func (s XcodebuildArchiver) createCodesignManager(config Config) (codesign.Manag
715716
}
716717

717718
connectionInputs := codesign.ConnectionOverrideInputs{
718-
APIKeyPath: config.Inputs.APIKeyPath,
719-
APIKeyID: config.Inputs.APIKeyID,
720-
APIKeyIssuerID: config.Inputs.APIKeyIssuerID,
719+
APIKeyPath: config.Inputs.APIKeyPath,
720+
APIKeyID: config.Inputs.APIKeyID,
721+
APIKeyIssuerID: config.Inputs.APIKeyIssuerID,
722+
APIKeyEnterpriseAccount: config.Inputs.APIKeyEnterpriseAccount,
721723
}
722724

723725
appleAuthCredentials, err := codesign.SelectConnectionCredentials(authType, serviceConnection, connectionInputs, s.logger)

vendor/github.com/bitrise-io/go-xcode/appleauth/auth_source.go

Lines changed: 0 additions & 188 deletions
This file was deleted.

vendor/github.com/bitrise-io/go-xcode/appleauth/fetch.go

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)