Giter Club home page Giter Club logo

cusdeb-anonymous's Introduction

CusDeb Anonymous

CusDeb Anonymous is a microservice intended for issuing JWT tokens for anonymous access to CusDeb.

Installation

$ git clone https://github.com/tolstoyevsky/cusdeb-anonymous.git
$ virtualenv -ppython3 cusdeb-anonymous-env
$ source cusdeb-anonymous-env/bin/activate
(cusdeb-helpik-env) $ cd cusdeb-anonymous
(cusdeb-helpik-env) $ python3 setup.py install
(cusdeb-helpik-env) $ python3 bin/server.py

Configuration

The microservice can be configured via the following environment variables (called params).

Param Description Default
ALGO The algorithm used for encoding the JWT tokens. HS256
ISSUE_DELAY The delay (in seconds) in issuing the JWT tokens. 5
PORT The port the CusDeb Anonymous server listens on. 8007
SECRET_KEY The secret key used for encoding the JWT tokens. It's HIGHLY RECOMMENDED to change the default value. secret
TIME_ZONE A string representing the time zone for this installation. See the list of time zones. Europe/Moscow
TOKEN_TTL How long (in seconds) the JWT tokens are alive. 20

API

  • URI: /anonymous/
  • Method: GET
  • Params: None
  • Success Response
    • Code: 200
    • Content: an encoded JWT token
      Each JWT token issued by the microservice has the following payload: {'token_type': 'access', 'exp': <exp>, 'jti': '<jti>', 'user_id': -1}, where
      • token_type is obviously a token type. The field always contains access. A refresh token is not provided, therefore to obtain a new access token, invoke the endpoint once again.
      • exp is an expiration date (see the TOKEN_TTL param above). It accepts integer numbers known as Unix timestamps.
      • jti is a JWT ID (see Section 4.1.7 of RFC 7519).
      • user_id is the pseudo id of an anonymous user. The field always contains -1 to let clients easily distinguish the pseudo id from a real one.

Authors

See AUTHORS.

Licensing

CusDeb Anonymous is available under the Apache License, Version 2.0.

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.