Skip to content

Add option to allow HTTP (not HTTPS) registries #7204

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 4 commits into from
Feb 15, 2024

Conversation

Footpad
Copy link
Contributor

@Footpad Footpad commented Dec 16, 2023

Resolves #7170: this adds an option to the package-registry set and publish commands to allow using an HTTP registry endpoint, bypassing the existing requirement that package registries use HTTPS.

Motivation:

In short, the motivation is to allow publishing to a registry that is hosted on a local machine. It is difficult to host a fully TLS-compliant HTTPS endpoint on developer machines at scale. See more detail in #7170

Modifications:

  • Adds a new allowInsecureHTTP flag to the Registry model.
  • Adds a new --allow-insecure-http flag to the package-registry set and publish commands.
  • Adds tests that validate the behavior of the model and command additions.
  • Adds tests that validate the requested constraints in Support for non-HTTPS localhost registries #7170 regarding HTTP endpoints, such as not being able to publish to an HTTP endpoint if there is authentication configured for it, and login command requiring HTTPS.

Result:

We will be able to use the swift CLI to publish to our HTTP registries locally hosted on our development machines. As a result, we will be able to migrate to the official tooling instead of needing to continue using home-rolled publish tooling.

@yim-lee
Copy link
Contributor

yim-lee commented Dec 16, 2023

@swift-ci please test

@MaxDesiatov MaxDesiatov added enhancement registry SwiftPM Registry-related changes labels Dec 18, 2023
@MaxDesiatov MaxDesiatov changed the title Adds option to allow HTTP (not HTTPS) registries Add option to allow HTTP (not HTTPS) registries Dec 20, 2023
@MaxDesiatov
Copy link
Contributor

Hi @Footpad, thank you for your contribution! Would you be willing to address feedback on this PR and get it over the finish line?

@Footpad
Copy link
Contributor Author

Footpad commented Feb 13, 2024

My apologies for the delay in checking back in on this PR - it has been quite busy since the holidays!

There's an outstanding feedback that I'd like to get more input on from the team in terms of which direction we should take the feedback. Please take a look and let me know how we should proceed. Thanks!

@Footpad Footpad requested a review from bnbarham as a code owner February 14, 2024 17:30
@Footpad
Copy link
Contributor Author

Footpad commented Feb 15, 2024

Updated PR incorporating feedback

@MaxDesiatov MaxDesiatov requested a review from yim-lee February 15, 2024 12:43
@MaxDesiatov
Copy link
Contributor

@swift-ci test

Copy link
Contributor

@yim-lee yim-lee left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for your work @Footpad!

@MaxDesiatov
Copy link
Contributor

@swift-ci test windows

@MaxDesiatov MaxDesiatov enabled auto-merge (squash) February 15, 2024 17:12
@MaxDesiatov MaxDesiatov merged commit a1b4ad7 into swiftlang:main Feb 15, 2024
@Footpad Footpad deleted the allow-insecure-http branch February 15, 2024 19:43
@Footpad
Copy link
Contributor Author

Footpad commented Feb 15, 2024

Thanks folks for the help in getting this merged! Appreciate your patience as well 😄

furby-tm pushed a commit to wabiverse/swift-package-manager that referenced this pull request May 15, 2024
Addresses swiftlang#7170: this adds an option to the `package-registry` `set` and
`publish` commands to allow using an HTTP registry endpoint, bypassing
the existing requirement that package registries use HTTPS.

### Motivation:

In short, the motivation is to allow publishing to a registry that is
hosted on a local machine. It is difficult to host a fully TLS-compliant
HTTPS endpoint on developer machines at scale. See more detail in swiftlang#7170

### Modifications:

* Adds a new `allowInsecureHTTP` flag to the Registry model.
* Adds a new `--allow-insecure-http` flag to the `package-registry`
`set` and `publish` commands.
* Adds tests that validate the behavior of the model and command
additions.
* Adds tests that validate the requested constraints in swiftlang#7170 regarding
HTTP endpoints, such as not being able to publish to an HTTP endpoint if
there is authentication configured for it, and `login` command requiring
HTTPS.

### Result:

We will be able to use the `swift` CLI to publish to our HTTP registries
locally hosted on our development machines. As a result, we will be able
to migrate to the official tooling instead of needing to continue using
home-rolled publish tooling.
furby-tm pushed a commit to wabiverse/swift-package-manager that referenced this pull request May 15, 2024
Addresses swiftlang#7170: this adds an option to the `package-registry` `set` and
`publish` commands to allow using an HTTP registry endpoint, bypassing
the existing requirement that package registries use HTTPS.

### Motivation:

In short, the motivation is to allow publishing to a registry that is
hosted on a local machine. It is difficult to host a fully TLS-compliant
HTTPS endpoint on developer machines at scale. See more detail in swiftlang#7170

### Modifications:

* Adds a new `allowInsecureHTTP` flag to the Registry model.
* Adds a new `--allow-insecure-http` flag to the `package-registry`
`set` and `publish` commands.
* Adds tests that validate the behavior of the model and command
additions.
* Adds tests that validate the requested constraints in swiftlang#7170 regarding
HTTP endpoints, such as not being able to publish to an HTTP endpoint if
there is authentication configured for it, and `login` command requiring
HTTPS.

### Result:

We will be able to use the `swift` CLI to publish to our HTTP registries
locally hosted on our development machines. As a result, we will be able
to migrate to the official tooling instead of needing to continue using
home-rolled publish tooling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement registry SwiftPM Registry-related changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for non-HTTPS localhost registries
3 participants