Giter VIP home page Giter VIP logo

accumulation's People

Contributors

tony824 avatar

Watchers

 avatar  avatar

accumulation's Issues

Enable creating job to execute Clojure code at server side

Context:
As a developer, I need put some cheap Clojure code in HTTP req and ask the server to run this piece of code for me.

Acceptance Criteria:

  1. Create the job
    POST req /v1/jobs with params {:job-name "Sum 100 and 2" :user-id 4 :job-content "(+ 100 2)"}
    a) authenticate the user and return 401 when the user is not logged on
    b) authenticate the user and return 403 when the user does't have permission to create jobs
    c) return 404 when there is an error in url
    d) return 400 when missing params or the submitted code has syntax errors . Params could be users, job name , job content (Clojure code)
    e) return 200 and job-id if everything is good. e.g.{:job-id 123}

  2. Check the job status by job-id and get results when the job is done
    GET /v1/job/:job-id
    a) authenticate the user and return 401 when the user is not logged on
    b) authenticate the user and return 403 when the user does't have permission to query the job
    Note: super admins have permissions to query any jobs
    c) return 200 and {:status "In progress"} job status could also be not found, in queue
    d) return 200 and result when the job is finished. e.g. {:status "Finished" :result "102"}

  3. Control this feature by env var ENABLE_JOB, when no var or set ENABLE_JOB=false return 400 with message not enabled feature

Release Note for users:

  1. Ensure the env var is set before using
  2. Ensure you have the permission to create job
  3. Ensure you have the permission to query job status or job results

Deploy Note for system team:
set env var. ENABLE_JOB

Impact on confidentiality:
No, this feature doesn't affect existing confidentiality

Impact on availability
No, this feature doesn't affect existing availability

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.