Team group doesn't work with team with whitespace in its name
Closed this issue · 1 comments
Bug Report
Versions
Version | |
---|---|
Verdaccio | 5.10 |
This plugin | 3.2.7 |
Node.js | 14.18.2 |
Environment
Name | Version | |
---|---|---|
Package manager | npm | 8.3.0 |
Browser | Microsoft Edge | 102.0.1245.33 (64-bit) |
Operating system | Windows 11 | 22000.708 |
Observed behavior
Can't assign package access to a GitHub team with whitespace in its name.
Expected behavior
Package access config should work with team with whitespace in its name.
Steps to reproduce
- Create a GitHub team with whitespaces in its name,
Package Publisher
in organizationMyOrg
for example. - With a working verdaccio instance, add package access config to this team, like:
publish: 'github/owner/MyOrg/team/Package Publisher'
, then restart verdaccio server. - Login with a user in this team, in server log, notice group of the team does not appear in
real_groups
- Try npm publishing a package as a member of
Package Publisher
. - npm fail with 403 Forbidden
- Change team name to
PackagePublisher
on GitHub. - Change group name in config file to
publish: 'github/owner/MyOrg/team/PackagePublisher'
and restart server. - Login again, group of the team shows up in server log.
- Do npm publish again.
- npm publish succeed.
Thanks for reporting.
It appears values with spaces aren't read from the verdaccio config correctly, even when quoted with single or double quotes. This seems to be a bug in Verdaccio or one of the libraries it uses.
We can still support team names with spaces by using the team slug instead of the raw team name. They should be the same in most cases, except the slug uses dashes instead of spaces. The switch to using the team slug is implemented in https://github.com/n4bb12/verdaccio-github-oauth-ui/releases/tag/3.2.8
In your case, this means you need to use: github/owner/MyOrg/team/Package-Publisher