Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

Allow to ls a directory.#46

Merged
dmndpl merged 3 commits intomasterfrom
add-way-to-ls-dirs
Jul 24, 2019
Merged

Allow to ls a directory.#46
dmndpl merged 3 commits intomasterfrom
add-way-to-ls-dirs

Conversation

@nathankleyn
Copy link
Copy Markdown
Contributor

Add a new endpoint to ls a directory to see all the files underneath.
The files are returned as a JSON array of strings representing the
relative paths of the files underneath the given directory.

The result is non-recursive because otherwise there is an opportunity to
DOS the server with a large response on a deep directory tree — it seems
more unlikely that there is a directory with children directly under it
large enough to break this but of course the risk there is also
non-zero.

The endpoint is /repos/<name>/ls/<path>.

Add a new endpoint to `ls` a directory to see all the files underneath.
The files are returned as a JSON array of strings representing the
relative paths of the files underneath the given directory.

The result is non-recursive because otherwise there is an opportunity to
DOS the server with a large response on a deep directory tree — it seems
more unlikely that there is a directory with children directly under it
large enough to break this but of course the risk there is also
non-zero.

The endpoint is `/repos/<name>/ls/<path>`.
Get typesafety whilst passing paths around, rather than having stringly
typed APIs. This is pretty straightforward a change because Serde
handles this absolutely a-ok with no changes on our behalf — yay!
Macro derives are provided, via proc macros, by actix for `Message` and
`MessageResponse` which means we don't need _any_ of the duplicated
boilerplate that was there! Awesome!
@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #46 into master will increase coverage by 5.96%.
The diff coverage is 96.82%.

@@            Coverage Diff             @@
##           master      #46      +/-   ##
==========================================
+ Coverage   83.02%   88.99%   +5.96%     
==========================================
  Files           3        3              
  Lines         218      309      +91     
==========================================
+ Hits          181      275      +94     
+ Misses         37       34       -3

Copy link
Copy Markdown

@dmndpl dmndpl left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@dmndpl dmndpl merged commit 987eba9 into master Jul 24, 2019
@dmndpl dmndpl deleted the add-way-to-ls-dirs branch July 24, 2019 10:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants