DESCRIPTION
Each comment is uniquely identified by database assigned, serially
incremented ID. Access controlled REST endpoint is added to delete
comment by ID.
ERRORS RETURNED
- Gist doesn't exist: 404 GistNotFound
- Gist is private and requesting user is not owner or is not visible
to user: 404 GistNotFound
- Gist exists and is visible to requesting user but comment doesn't
exist: 404 CommentNotFound
- Gist exists and is visible to requesting user is not comment owner
: 401 UnauthorizedOperation
DESCRIPTION
Get all comments on a gist. Access controlled but optionally
authenticated HTTP REST endpoint is added to get comment by ID.
ERRORS RETURNED
- Gist doesn't exist: 404 GistNotFound
- Gist is private and requesting user is not owner or is not
authenticated: 404 GistNotFound
DESCRIPTION
Each comment is uniquely identified by database assigned, serially
incremented ID. Access controlled but optionally authenticated HTTP
REST endpoint is added to get comment by ID.
ERRORS RETURNED
- Gist doesn't exist: 404 GistNotFound
- Gist is private and requesting user is not ower or is not
authenticated: 404 GistNotFound
- Comment is empty: 400 EmptyComment
- Gist exists and is visible to requesting user but comment doesn't
exist: 404 CommentNotFound
SUMMARY
Comment on gist and utilities to generate post comment REST
endpoint route from username and gist public ID component
ERRORS
- Gist doesn't exist, 404 GistNotFound is returned
- Gist is private and commenting user is not ower, 404 GistNotFound
is returned
- Comment is empty, 400 EmptyComment is returned
SUMMARY
Optionally authenticated endpoint to read file in gist repository.
Subject to gist visibility.
DESCRIPTION
crate::api::v1::gists::read_file
- Parses URI for gist owner, gist public ID and file path.
- Contents of gists with private visibility are only returned
to owner of gists. Identity determined using session cookies.
- Contents are Unlisted and Public visibility gists are
accessible by both unauthenticated and authenticated
users(authenticated but not owner).
SUMMARY
This program supports directories in gists. This patch modifies
Data::read_file to support directory reads. Additionally,
CreateGistRequest is modified to accept files in subdirectories.
DESCRIPTION
Data::read_file
When repository contains subdirectories, it will recursively
read all files and return their contents.
crate::data::api::v1::gists::GitFileMode
Set of known(to me) file modes that Git uses.
GitFileMode::Unsupported is used to take advantage of
num_enum::FromPrimitive. The alternative would have been
num_enum::TryFromPrimitive, which returns errors on unsupported
values. I felt the former was cleaner.
SUMMARY
Binary content is essential to store images. ContentType enum
accommodates both utf-8 and and non utf-8 encodings.
Data::write_file and Data::read_file are modified to handle
ContentType enum
AUTHENTICATION
- Sign Up
- Sign IN
ACCOUNT
- Username Exists
- Email Exists
- Account delete
- Password update
- Email update
- Username update
- Get account secret
- Update secret
All routes are implemented with proper error handling and testing
CONFIGURATION
See ./config/default.toml for full list