Restrict Organizations (Public GitHub) #44
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What did you implement:
Closes #36
Allow new environment variable
CODEBOX_RESTRICTED_ORGSyou can set with comma separated list of organization names that are only allowed access. e.g.org1,org2.This allows organisations on public GitHub the ability to grant access to their GitHub application and ensure only those part of the restricted organizations list can then get access to your registry.
Without setting this environment variable anyone with a GitHub / GitHub Enterprise account can have read access to your npm registry by default. We want to allow read access by default as in the enterprise we want to foster productivity and not hamper access in order for
npm installsto work.How did you implement it:
CODEBOX_RESTRICTED_ORGSvariable is set then check access against github to see if the user belongs to that org if so they get access.CODEBOX_ADMINSvariable as organization roles in GitHub are eithermemberoradminwhich is way too wide to cater for gradual roll out of publishers. Not all team members will be admins of an organization that should have publish rights.How can we verify it:
npm infooperation andnpm publishTodos:
ready for revieworwipIs this a breaking change?: NO