Giter Club home page Giter Club logo

Comments (4)

Gibby avatar Gibby commented on June 11, 2024

P.S. Awesome work, been waiting for something like this to switch over to bashhub-client

from bashhub-server.

nicksherron avatar nicksherron commented on June 11, 2024

Thanks for the feedback!
Currently, authentication is handled with jwt tokens , which I hadn't had any experience with until recently so the implementation might need some work and better documentation but basically, the workflow is

  • POST request to /api/v1/user creates a user, salts the password and stores the username and password hash in the db
curl  http://localhost:8080/api/v1/user -d '{"registrationCode": "", "username": "user", "password": "pass", "email": "[email protected]"}'
  • /api/v1/login authenticates user by checking the user and salt hash and returns a access token upon sucessfull lookup.
 curl "http://localhost:8080/api/v1/login" -H "Content-Type:application/json" -d '{"username": "user", "password": "pass"}'
{"accessToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MTczNDYwOTQsIm9yaWdfaWF0IjoxNTgxMzQ2MDk0LCJzeXN0ZW1OYW1lIjoiIiwidXNlcm5hbWUiOiJ1c2VyIn0.IpzpfMuk5wLaie62ShJu0AZL0RmjLjGHEjzfehAd-kQ"}

which the bashhub client store in the config file at $BH_HOME_DIRECTORY/config and any other endpoints require for access. Which is all the routes after after

r.Use(authMiddleware.MiddlewareFunc())

Is that kind of what you're talking about? Or do you think adding something like basic auth as an option
like

curl http://user:password@localhost:8080/any/path

would be good to add as well? I'm open to suggestion but I'd like to stay away from anything too complicated like the jwilder/nginx-proxy . If people want to put something like nginx or apache in front of the bashhub-server (which is probably a good idea) and add their own ssl stuff that's probably best done separately.

from bashhub-server.

Gibby avatar Gibby commented on June 11, 2024

I'm setting up the tests right now, I didn't realize that JWT was already setup for the server and client so that should be good.

Also for nginx/ssl, I was just making the comment that, that is how I offload ssl. Nothing needed on this project since you already built the docker image for bashhub-server.

from bashhub-server.

nicksherron avatar nicksherron commented on June 11, 2024

I'm setting up the tests right now, I didn't realize that JWT was already setup for the server and client so that should be good.

Ok good. I'm going to close this then. Thanks for the input, I added the JWT authentication to the readme since it wasn't clear.

from bashhub-server.

Related Issues (20)

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.