Giter VIP home page Giter VIP logo

chaparral's People

Contributors

srerickson avatar

Stargazers

 avatar  avatar

Watchers

 avatar

chaparral's Issues

file sizes

figure out how to get file size information into the object cache.

improved tests

  • clean up commit service tests
  • need more tests for main package's run.Run()

URL signing for file downloads/uploads

Currently, download links for files won't work well in web browsers because an authorization header (bearer token) needs to be included with the download request. To make it easier use chaparral with browser-based front-ends, I need to add a way to generate signed urls for restricted files.

Something like this: GetSigneDownloadURL(resource, expire) returns a URL with a (single-use?) token as a query parameter.

commit fails with object content source

This commit request fails:

{
  "storageRootId": "working",
  "objectId": "demo-object-03",
  "message": "this is a test",
  "state": {
    "file.zip": "21dd1dff33fcd1ece989869bb4677c2be7407b0e4c36d7daddf89608c43e2135"
  },
  "user": {
    "name": "Seth Erickson"
  },
  "digestAlgorithm": "sha256",
  "contentSources": [
    {"object":{
      "storageRootId": "restricted",
      "objectId": "45545/1937/07/02"}}
  ]
}

This is the erorr response:

{
  "code": "invalid_argument",
  "message": "commit error with possible object corruption: transferring new object contents: during copy: blob (key \"restricted/534/39a/9d0/45545%2f1937%2f07%2f02/v1/content/xml.zip -> working/76f/a6d/ac9/demo-object-03/v1/content/nytimes.zip\") (code=NotFound): NoSuchKey: The specified key does not exist.\n\tstatus code: 404, request id: FRN11A4363RMW577, host id: ZfrWeQhrnIEPhhIRPK8YYv0quJ/9uvP2kmpYzOlsW/tm0WHQaRitpYsMLh0AUsjOlUovEMAfSIWAb7/MPtvjrw=="
}

The bug most likely stems from the fact that object id used as a content source includes '/'. For comparison, this commit request works as expected:

{
  "storageRootId": "working",
  "objectId": "demo-object-04",
  "message": "this is a test",
  "state": {
    "file.zip": "53a6da718ab3da9364769d3622a2cc7dc48b2f61b6a5db3f9ed8b77969f90bfb"
  },
  "user": {
    "name": "Seth Erickson"
  },
  "digestAlgorithm": "sha256",
  "contentSources": [
    {"object":{
      "storageRootId": "restricted",
      "objectId": "index"}}
  ]
}

delete a partial/incomplete object

Delete requests should be able to clean up partial/incomplete objects. It should check that there is an object declaration file, but not require additional validation.

Get rid of "Storage Groups"

The storage group abstraction was meant to allow collections of storage roots with the same backend to be managed together, along with the uploader for the backend. Instead it's become another identifier that has to get added to every request -- the storage root identifier on its own should be sufficient. Storage roots and uploaders can share the same backend behind the scenes, but this doesn't need to be something the API user should be concerned with.

server image default and startup examples

This should initialize a storage root and start the server:

docker run --rm  -v $(pwd):/data -p 8080:8080 srerickson/chaparral 

The server container image should be configured with functional defaults, such as:

  • Backend set to /data
  • initialize an OCFL storage root in /data
  • listen on :8080

Storage Root Index

Minimally, add an API endpoint for paging through all the object ids in a storage root. Also consider one that triggers a reindex of a storage root.

fix default container configs

the CHAPARRAL_BACKEND environment variable set in the Docker container is preventing downstream images from setting the backend using a config file. (fig privileges environment variables of config files values)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.