Skip to content
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

Add project preview image API #1477

Merged
merged 1 commit into from Jun 25, 2020

Conversation

Nitish145
Copy link
Member

Describe the changes you have made in this PR -

Add /api/v1/project/:id/image_preview to GET public project's full image url

Screenshots of the changes (If any) -

{
  "project_preview": "http://localhost:3000/img/default.png"
}

Note: Please check Allow edits from maintainers. if you would like us to assist in the PR.

@codeclimate
Copy link

codeclimate bot commented Jun 2, 2020

Code Climate has analyzed commit 33791f4 and detected 0 issues on this pull request.

View more on Code Climate.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 84.41% when pulling 33791f4 on Nitish145:project_image_api into ff11ebb on CircuitVerse:master.

@Nitish145
Copy link
Member Author

@satu0king @tachyons please check!!

@satu0king
Copy link
Member

Looks good to me! Thanks
@tachyons can you review and merge the same.

@@ -34,6 +34,11 @@ def show
render json: Api::V1::ProjectSerializer.new(@project, @options)
end

def image_preview
@project = Project.open.find(params[:id])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about private projects? They don't have preview images ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They do have but @satu0king asked me for public projects only, is that right @satu0king ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes idea is that we don't want private project's preview image to get leaked this way. @tachyons is there a better way or its fine to do that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@satu0king We can return 403 if the user is not authorized to view this project, right?

@Nitish145 Nitish145 requested a review from satu0king June 8, 2020 15:55
@tachyons tachyons merged commit 8b29336 into CircuitVerse:master Jun 25, 2020
@Nitish145 Nitish145 deleted the project_image_api branch October 1, 2020 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants