openlawlibrary / stelae

Preservation, Authentication, Access
GNU Affero General Public License v3.0
7 stars 1 forks source link

feat: Serve current documents #32

Closed n-dusan closed 8 months ago

n-dusan commented 9 months ago

Closes #18 Closes #29 Closes #31

This PR adds support for:

  1. Serving current blobs (documents) for git repositories. We use git HEAD commit to get current blob.
  2. Multi-host serve for git repositories based on guarded header value.

Support for serving current blobs for git repositories.

Add stelae serve cli command, which spins up the server and serves documents from Stele data repositories in an archive.

For testing framework, add tests for three possible archives for serving current documents are basic, multijursdiction, multihost. Basic archive is an archive with one stele that has multiple data repositories. Multijursdiction archive is an example of Stele referencing other Stele with dependencies.json. Multihost archive is enabled by using the current_documents_guard in config.toml

Multi-host serve for git repositories based on guarded header value.

When config.toml sets a current_documents_guard header, we expect the HTTP requests to Stele to contain a guarded header. So requests which don't match the expected guarded header aren't resolved.

n-dusan commented 8 months ago

Thanks, @tombh! I agree, definitely didn't need to have those Git hooks and logs, etc. I believe I've addressed all comments, so re-requested review.