-
-
Notifications
You must be signed in to change notification settings - Fork 239
feat: add new custom resolver to fetch the reference from private repo #1810
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
base: master
Are you sure you want to change the base?
Conversation
…and add new command auth add
Changeset has been generated for this PR as part of auto-changeset workflow.Please review the changeset before merging the PR.
If you are a maintainer or the author of the PR, you can change the changeset by clicking here Tip If you don't want auto-changeset to run on this PR, you can add the label |
🦋 Changeset detectedLatest commit: 181dbb9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Tests and documentation need to be updated, i will update after getting ack from this approach : )
![]()
![]() New feature:
![]() Repo URL format: https://github.com/AayushSaini101/AayushSaini101/tree/main
![]() |
schema: 'https', | ||
order: 1, | ||
|
||
canRead: (uri: URI) => uri.hostname() === 'raw.githubusercontent.com', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why checking for GitHub here? 🤔 References can be in many places, not just GitHub, and even in such a case the GitHub deployment might be in a private domain, which is pretty common in medium to large companies.
|
||
read: async (uri: URI) => { | ||
const url = uri.toString(); | ||
const normalized = normalizeRawGitUrl(uri); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the URL is not pointing to a GitHub repo? This could perfectly be a Schema Registry URL, an S3 bucket, some random URL, or even a GitLab or BitBucket URL.
const token = matched.token.startsWith('$') | ||
? process.env[matched.token.slice(1)] || '' | ||
: matched.token; | ||
headers['Authorization'] = `Bearer ${token}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some systems don't use Bearer tokens. Some might accept jwt
or api-key
or actually whatever the API designer wants to put there. We shouldn't hardcode it, that's why in my definition of the task I added some alternative examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure @fmvilas i will update it
/u |
|
@fmvilas For the private Github URL should be in this format: like https://api.github.com/repos/AayushSaini101/AayushSaini101/contents/user-signedup.yaml, not direct URL like we simple copy the path of the URL from the private repo, this is the github url, not sure about the private repo, in short we need to compare each and every url and create special check to find whether it is matching with the stored pattern or not, we can start with the github and gitlab pattern then we can slowly slowly add the comparison format as we grow thanks |
Resolves: #1796