Skip to content

[Collections] Auth tokens need to be mutable #3443

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

Merged
merged 2 commits into from
Apr 28, 2021

Conversation

yim-lee
Copy link
Contributor

@yim-lee yim-lee commented Apr 24, 2021

rdar://77095793

@yim-lee
Copy link
Contributor Author

yim-lee commented Apr 24, 2021

@swift-ci please smoke test

@@ -67,6 +67,14 @@ public struct PackageCollections: PackageCollectionsProtocol {
}
}

public mutating func updateAuthTokens(_ authTokens: [AuthTokenType: String]?) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not my favorite approach. Open to other options. I don't think the API should be added to PackageCollectionsProtocol though.

Copy link
Contributor

@tomerd tomerd Apr 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about a setter for either authTokens or making configuration public?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also another approach is to define Configuration::authToken to take a function that is called to retrieve the auth values

var authTokens = () -> [AuthTokenType: String]?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also another approach is to define Configuration::authToken to take a function

I like this. Thanks. Changed impl to this instead. bb67334

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The approach in bb67334 is a breaking change though, so my original approach might be safer... 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its okay to break at this point if we think its the right API, we just need to coordinate landing it cc @neonichu

@yim-lee yim-lee force-pushed the mutate-auth-tokens branch from 495cf4b to bb67334 Compare April 27, 2021 01:57
@yim-lee
Copy link
Contributor Author

yim-lee commented Apr 27, 2021

@swift-ci please smoke test

1 similar comment
@yim-lee
Copy link
Contributor Author

yim-lee commented Apr 27, 2021

@swift-ci please smoke test

@tomerd
Copy link
Contributor

tomerd commented Apr 27, 2021

@swift-ci please smoke test macOS

@yim-lee yim-lee force-pushed the mutate-auth-tokens branch from bb67334 to c27410e Compare April 28, 2021 04:09
@yim-lee
Copy link
Contributor Author

yim-lee commented Apr 28, 2021

Rebased. @swift-ci please smoke test.

@yim-lee yim-lee merged commit 782efe9 into swiftlang:main Apr 28, 2021
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Apr 28, 2021
* [Collections] Auth tokens need to be mutable

rdar://77095793

* Change authTokens to be a function instead
@yim-lee yim-lee deleted the mutate-auth-tokens branch April 28, 2021 23:44
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Apr 29, 2021
* [Collections] Auth tokens need to be mutable

rdar://77095793

* Change authTokens to be a function instead
neonichu pushed a commit that referenced this pull request Apr 30, 2021
* [Collections] Auth tokens need to be mutable

rdar://77095793

* Change authTokens to be a function instead
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants