-
Notifications
You must be signed in to change notification settings - Fork 3
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
Package upload api #19
Comments
When @henilp105 & I created the upload API, it was supposed that information such as Should I remove these fields for now from the backend or just use a default value for all the packages. So, that the other APIs which are trying to fetch it does not break or can you send this data from fpm as well ? The data that we might need but it's not necessary right now :
The data which is necessary and needs to be sent from fpm includes:
|
Should we add time based expiry on the token or naming the tokens , as we would also have to add the functionality to revoke the tokens or expire them after certain time period. |
Exactly @henilp105 , That's how it should be. But considering the time-frame we can maybe add later as well. |
So, are we currently making the tokens irrevocable tokens which the user won't be able to re-view after creating them once. ( every time the user requests a new token would be generated. ) |
Yes, I think that works for now. But, we have to keep in mind that tokens should expire after certain amount of time & also an API + UI for deleting the generated tokens should be good. |
The post request for the API should be sent in the form of form-data like this:
I have changed the deployment to use vercel for now because it is fast than render.com & not causing any errors now. Url - https://registry-apis.vercel.app/ Endpoint :
I will separately DM the upload token that @minhqdao & @perazz can use to make the requests. |
We have a |
I'm not quite sure what you mean by sending form data. I hope we are not mixing frontend with backend techniques here. I will send data via the We had this discussion already when we were thinking about sending a list of cached versions to the backend to determine whether we need to download a version or not. |
Yes, let's just ignore the optional fields for now and deliver them as soon as possible. |
I would agree here. |
There must be a way in I am thinking to use multipart/form-data because it will enable the upload of tarball files. |
Of course we could change the content type in the header to |
We could use the We are trying to access the file i.e tarball using I read the blog shared above, it also mentions "The HTTP content type for this format is “application/x-www-form-urlencoded.” This works fine for simple input fields, but web pages may also allow users to upload one or more files. To support this, another format was created in the early days of the web, and it is known by its content type, which is “multipart/form-data.” |
I see, if |
Okay, But now I see you can use something like this to upload as well.
|
Yes, I also think it's fine to stick to |
Looks good. Then we can upload files from the frontend website as well. Edit : Found that we could not then send the other metadata with file if we just use -d flag. So, we will be forced to use multipartform content-type |
In the last meeting, I discussed with @perazz , about the current issue with having a namespace token for uploading packages. Currently, namespace maintainers can create tokens that are used for uploading the packages to the namespace. But, we also have a package maintainer role. Package maintainers are only responsible for maintaining packages (uploading new versions, adding other maintainers to the package). But, currently, in order to get the token you have to be a namespace maintainer. Suppose, I add a person as a package maintainer thinking now they can be able to upload new versions of that package and now they want token from me because I am a namespace maintainer and hence they can't work independently and have to be dependent on the namespace maintainer for upload tokens which basically questions the role of package maintainer in itself. So, I have a solution to allow package maintainers to generate tokens for the package itself and the token can be then used to upload a new version of that particular package. For the @minhqdao @henilp105 @perazz What are your thoughts about this ? |
Thanks, @arteevraina. I think that's perfect. A package maintainer should be able to generate tokens for that particular namespace + package, but not for other packages of that namespace. |
Let's define the api for uploading packages. How do you want a JSON request for uploading a package to look like? @arteevraina @henilp105
The text was updated successfully, but these errors were encountered: