-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Incorporate feedback from 2nd review of SE-0292 #1319
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
Changes from 7 commits
1947dce
5b568fa
4f019d3
526fe33
79d1377
372c605
ac89166
d44d47a
ed0c440
c03e612
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -117,8 +117,8 @@ and downloading the source archive for a release: | |
| | `GET` | `/{scope}/{name}/{version}.zip` | Download source archive for a package release | | ||
| | `GET` | `/identifiers{?url}` | Lookup package identifiers registered for a URL | | ||
|
|
||
| A formal specification for the package registry interface | ||
| is provided alongside this proposal. | ||
| A formal specification for the package registry interface is provided | ||
| [alongside this proposal](https://github.com/apple/swift-package-manager/blob/main/Documentation/RegistryDraft.md). | ||
| In addition, | ||
| an OpenAPI (v3) document | ||
| and a reference implementation written in Swift | ||
|
|
@@ -145,11 +145,11 @@ A package scope consists of | |
| alphanumeric characters and hyphens. | ||
| Hyphens may not occur at the beginning or end, | ||
| nor consecutively within a scope. | ||
| The maximum length of a package name is 39 characters. | ||
| The maximum length of a package scope is 39 characters. | ||
| A valid package scope matches the following regular expression pattern: | ||
|
|
||
| ```regexp | ||
| \A[a-zA-Z\d](?:[a-zA-Z\d]|-(?=[a-zA-Z\d])){0,39}\z | ||
| \A[a-zA-Z\d](?:[a-zA-Z\d]|-(?=[a-zA-Z\d])){0,38}\z | ||
| ``` | ||
|
|
||
| A package's *name* uniquely identifies a package in a scope. | ||
|
|
@@ -163,16 +163,9 @@ A valid package name matches the following regular expression pattern: | |
| > For more information, | ||
| > see [Unicode Identifier and Pattern Syntax][UAX31]. | ||
|
|
||
| Package scopes are case-insensitive | ||
| (for example, `mona` ≍ `MONA`). | ||
| Package names are | ||
| case-insensitive, | ||
| diacritic-insensitive | ||
| (for example, `Å` ≍ `A`), and | ||
| width-insensitive | ||
| (for example, `A` ≍ `A`). | ||
| Package names are compared using | ||
| [Normalization Form Compatible Composition (NFKC)][UAX15]. | ||
| [Normalization Form Compatible Composition (NFKC)][UAX15] | ||
| with locale-independent case folding. | ||
|
|
||
| #### New `PackageDescription` API | ||
|
|
||
|
|
@@ -242,7 +235,7 @@ that is, the `package` parameter in `.product(name:package)` method calls. | |
|
|
||
| ```diff | ||
| targets: [ | ||
| .target(name: "MyLibrary", | ||
| .target(name: "MyLibrary", | ||
| dependencies: [ | ||
| .product(name: "LinkedList", | ||
| - package: "LinkedList") | ||
|
|
@@ -457,6 +450,8 @@ in the root directory of a package | |
| creates or updates the `.swiftpm/config/registries.json` file | ||
| with a new top-level `registries` key | ||
| that's associated with an object containing the specified registry URLs. | ||
| The default, unscoped registry is associated with the key `[default]`. | ||
| Any scoped registries are keyed by their case-folded name. | ||
|
|
||
| For example, | ||
| a build server that doesn't allow external network connections | ||
|
|
@@ -471,8 +466,8 @@ $ cat .swiftpm/config/registries.json | |
| ```json | ||
| { | ||
| "registries": { | ||
mattt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "default": { | ||
| "url": "https://internal.example.com" | ||
| "[default]": { | ||
| "url": "https://internal.example.com" | ||
| } | ||
| }, | ||
| "version": 1 | ||
|
|
@@ -507,7 +502,7 @@ $ cat .swiftpm/config/registries.json | |
|
|
||
| ```json | ||
| { | ||
| "registries": { | ||
| "registries": { | ||
| "example": { | ||
| "url": "https://internal.example.com" | ||
| } | ||
|
|
@@ -557,8 +552,8 @@ consider the following global and local registry configuration files: | |
| ```jsonc | ||
| // Global configuration (~/.swiftpm/config/registries.json) | ||
| { | ||
| "registries": { | ||
| "default": { | ||
| "registries": { | ||
| "[default]": { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does square brackets have precedence in other such system? in Swift we usually use underbar for making "special" things
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I chose As far as precedence, Swift uses square brackets in closures to annotate capture semantics (
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I prefer we go with underbar
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 on
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree with @neonichu , Happy with
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Happy with any of @weissi's options there, I don't object to the |
||
| "url": "https://global.example.com" | ||
| }, | ||
| "foo": { | ||
|
|
@@ -570,7 +565,7 @@ consider the following global and local registry configuration files: | |
|
|
||
| // Local configuration (.swiftpm/config/registries.json) | ||
| { | ||
| "registries": { | ||
| "registries": { | ||
| "foo": { | ||
| "url": "https://local.example.com" | ||
| } | ||
|
|
@@ -786,7 +781,7 @@ and attempt to reuse those credentials to impersonate the user. | |
| ```json | ||
| { | ||
| "registries": { | ||
| "default": { | ||
| "[default]": { | ||
| "url": "https://<USERNAME>:<TOKEN>@swift.pkg.github.com/<OWNER>/" | ||
| } | ||
| }, | ||
|
|
@@ -796,7 +791,8 @@ and attempt to reuse those credentials to impersonate the user. | |
| ``` | ||
|
|
||
| This kind of attack can be mitigated on an individual basis | ||
| by adding `.swiftpm/config` to a project's `.gitignore` file. | ||
| by adding `.swiftpm/config` to a project's `.gitignore` file | ||
| or storing credentials in a `.netrc` file. | ||
mattt marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| The risk could be mitigated for all users | ||
| if Swift Package Manager included a `.gitignore` file | ||
| in its new project template. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.