Git Product home page Git Product logo

hakoirimusume's Issues

Implement User Authentication with Aikotoba

Functions

  • createNewAikotoba(issuerUserId) -> newAikotobaString || false (busy)
  • authenticate(aikotoba) -> isSuccussed
  • invalidateAikotoba()

Data

  • aikotobaString (String || null)
  • expirationTime (DateTime || null)
  • issuerUserId (String || null)

Process of authentication

A: user, B: new comer

  1. A request to create new aikotoba.
  2. A got new aikotoba.
  3. A tell aikotoba string to B.
  4. B requests authentication
  5. System replies "Start authentication. Please send me aikotoba".
    (And adds B to UserData database for state management)
  6. B send aikotoba string.
    If B send correct aikotoba
  7. B is added to user list. [END]
    If B send wrong aikotoba
  8. System replies "Your aikotoba is not correct. Please ask user to recreate aikotoba."
  9. System variable aikotobaString is set to null.
  10. If B resend the same wrong aikotoba.
  11. System replies "Your aikotoba is not correct. Please ask user to recreate aikotoba."
    (when aikotobaString==null, system always replies 'not correct.')
  12. Back to step 1.

Implement SQLite support

Functions

  • addUser(userId, authorityLevel) → result
  • setState(userId, newState) → result
  • resetState()

Database Design

UserData

UserID AuthorityLevel State LatestRequestTime
LINE UserID 0(noUser), 1(normalUser), 2(adminUser) int? DateTime, null
  • db connection is opend when each request is processed, and closed when system finished processing database for each request.
  • State is set to 0 when system is launched.

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.