-
Notifications
You must be signed in to change notification settings - Fork 37
Check that team has certificates #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check that team has certificates #81
Conversation
codesigndoc/codesigngroup.go
Outdated
| teams := []string{} | ||
| for team := range certificatesByTeam { | ||
| teams = append(teams, team) | ||
| if teamHasCertificates(archiveCertificate, certificatesByTeam[team]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the initial logic here is not correct, this function should work like:
- Do you wasnt to use the archive team for archive? (if multiple team's identity could create this archive)
no-> list the teams that could create this archive and let select - Ipa export method?
- Do you want to use the archive team for the ipa export (if multiple team's identity could export the archive)
no-> list the teams that could export this archive and let select
please update the whole function
godrei
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls have a look at my comments
…_codesigndoc_distribution_certificate_option_listed
codesigndoc/codesigngroup.go
Outdated
| _, contains := certificatesByTeam[fmt.Sprintf("%s - %s", archiveCertificate.TeamID, archiveCertificate.TeamName)] | ||
|
|
||
| // Skip if only 1 team has certificates on the machine. | ||
| if len(certificatesByTeam) > 1 && contains { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning if the archiving team does not have a certificate for the selected method.
| if err != nil { | ||
| return certificateutil.CertificateInfoModel{}, fmt.Errorf("failed to read input: %s", err) | ||
| } | ||
| } else if !contains { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add some comments for this cases, it is a little bit hard to understand
codesigndoc/codesigngroup.go
Outdated
| // Find the specific development certificate. | ||
| if !exportDistCert { | ||
| certificates := certificatesByTeam[selectedTeam] | ||
| developmentCertificates := certificateutil.FilterCertificateInfoModelsByFilterFunc(certificates, func(certInfo certificateutil.CertificateInfoModel) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the certsForSelectedExport
codesigndoc/codesigngroup.go
Outdated
| // Skip if only 1 team has certificates on the machine. | ||
| if len(certificatesByTeam) > 1 && contains { | ||
| question := fmt.Sprintf(`The archive used codesigning files of team: %s - %s | ||
| Would you like to use this team to sign your project?`, archiveCertificate.TeamID, archiveCertificate.TeamName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you like to use this team for the .ipa export?
4c6454f to
8e25678
Compare
codesigndoc/codesigngroup.go
Outdated
| // teamHasCertificates returns true if the team has certificate for the selected cert type. | ||
| // If isDistCert == true it will search for Distribution Certificates. If it's == false it will search for Developmenttion Certificates. | ||
| // If the team doesn't have any certificate for the selected cert type, it will return false. | ||
| func teamHasCertificates(isDistCert bool, certificates []certificateutil.CertificateInfoModel) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function does not care about the team, rename this function
codesigndoc/codesigngroup.go
Outdated
| archiveTeam := fmt.Sprintf("%s - %s", archiveCertificate.TeamName, archiveCertificate.TeamID) | ||
|
|
||
| fmt.Println() | ||
| log.Warnf("🚨 Only the archiving team (%s) has certificate for the %s export method", archiveTeam, selectedExportMethod) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use printf without the icon
349d7b7 to
3d5eb5f
Compare
codesigndoc/codesigngroup.go
Outdated
| // Skip the question + set the useArchiveTeam = false, if multiple team has certificate for the export method but the archiving team is not one of them. | ||
| if len(filteredCertificatesByTeam) > 1 && contains { | ||
| question := fmt.Sprintf(`The archive used codesigning files of team: %s - %s | ||
| Would you like to use this team to sign your project?`, archiveCertificate.TeamID, archiveCertificate.TeamName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you like to use this team to export an ipa file?
codesigndoc/codesigngroup.go
Outdated
| } | ||
|
|
||
| fmt.Println() | ||
| selectedTeam, err = goinp.SelectFromStringsWithDefault("Select the Development team to sign your project", 1, teams) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use export an ipa file or similar instead of sign your project
Fix for:
https://discuss.bitrise.io/t/no-codesigndoc-distribution-certificatea/4355