Giter Site home page Giter Site logo

auth-rbac-system's Introduction

πŸ’« About My Interest Areas and Familiar Tools

πŸ’» Programming Languages

Python F# C# C++ Java Rust JavaScript

πŸ’― Software Engineering Frameworks

.Net Spring React Native

🌐 Web Development

Blazor HTML5 CSS3 Bootstrap

♾️ DevOps Tech Stack

Kubernetes Docker Jenkins LINUX PowerShell Shell Script

⚜️ Quantum Computing

Qiskit Q# Β Β Β Β Β Β Β 

πŸ“‡ Databases

MariaDB MySQL

πŸ€– Artificial Intelligence & Deep Learning & Machine Learning

NumPy PyTorch SciPy scikit-learn

πŸ”§ Other Technical Tools

Git LaTeX Markdown Figma Jupyter Notebook YAML Vim

πŸ“Š GitHub Stats:


auth-rbac-system's People

Contributors

arthurbosquetti avatar zedrichu avatar

Stargazers

 avatar  avatar

Watchers

 avatar

auth-rbac-system's Issues

SessionManager.clearExpired() removes 'young' tokens

private void clearExpired() {
        activeTokens.entrySet().removeIf((x) ->
                x.getValue().getStartTime().until(LocalDateTime.now(),
                ChronoUnit.MINUTES) < TTL_MINUTES);
}

should removeIf(... > TTL_MINUTES instead!

SessionManager.validateSession() always returns false

In SessionManager.loginSingleUse():

if (authResult == ResponseCode.OK) {
            session = issueToken(userId);
            session.singleUse = true;
}

but when validating session:

public boolean validateSession(Session session) throws RemoteException {
        // ...
        if (session.singleUse) activeTokens.remove(session.getId()); // Always removes the token (singleUse is true if the user logged in)
        return activeTokens.containsKey(session.getId());  // And thus this is always false so no PrinterServant method can be executed
}

IPrinterService.start() and stop() should start/stop print server (not a job)

Assignment file:
start(); // starts the print server
stop(); // stops the print server

Our code:

public void start(Session session) throws RemoteException {
        if (!sessionManager.validateSession(session)) return;
        System.out.println("|> Printer job started");
    }
public void stop(Session session) throws RemoteException {
    if (!sessionManager.validateSession(session)) return;
    System.out.println("|> Printer job stopped");
}

Small renaming from Token to Session

public class SessionManager extends UnicastRemoteObject implements ISessionValidator, ISessionProvider {

    private final Authenticator authenticator;
    private static final int TTL_MINUTES = 60;
    private final HashMap<UUID, Session> activeTokens;

activeTokens should be renamed to: activeSessions..

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.