-
Notifications
You must be signed in to change notification settings - Fork 139
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
Added support for fastlane auth cookies #265
Conversation
|
||
func load(in storage: HTTPCookieStorage?) { | ||
do { | ||
guard let storage, var sessionVar = Current.shell.env(fastlaneSession) else { return } |
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.
I think it's also valuable to automatically load the cookie if it is present in the filesystem. fastlane stores it in the file ~/.fastlane/spaceship/email@domain.com/cookie
.
import Foundation | ||
import Yams | ||
|
||
struct FastlaneCookieLoader { |
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.
Do you mind adding some tests for this?
This will close #248 |
Also possible duplicate of #257 |
@omarzl can you close this PR if it isn't needed? |
Sure! |
Solves issue #141
Inspired by this fork commit: tahirmt@2da7761
fastlane spaceauth generates a YML session string so we can parse it directly and inject those cookies into the session's cookies storage.
I kept the
FASTLANE_SESSION
env var name to have direct support with fastlane.Steps
You will now be able to download Xcode in CI environments by first running locally:
And then in your CI scripts you can export the variable and run
xcodes
, it won't prompt for username/password/2fa:References:
https://github.com/fastlane/fastlane/blob/master/spaceship/lib/spaceship/client.rb#L280
https://github.com/sparklemotion/http-cookie/blob/master/lib/http/cookie_jar/yaml_saver.rb#L19