Comments (4)
P.S. Awesome work, been waiting for something like this to switch over to bashhub-client
from bashhub-server.
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
bashhub-server/internal/server.go
Line 229 in e7041b2
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.
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.
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)
- Make fails due to failed tests/lack of tests HOT 2
- Bad practice to write passwords in commands HOT 1
- Release Request: Qnap qpkg HOT 1
- Suggestion: Allow disabling user registrations HOT 3
- Migrate CI tests from travis to Github actions
- Bug: bashhub status results in 404 error HOT 3
- Feature request: environment variable for sqlite or postgres for docker image
- Feature request: Docker Support for ARM to use raspberrypi+docker for hosting HOT 2
- go/pkg/mod/github.com/nicksherron/[email protected]/internal/db.go:74:5: undefined: sqlite3.SQLiteDriver
- Also supply a bashhub-client with some possible feature enhancements. HOT 3
- tests in cmd/transfer_test.go are no longer passing
- Arch package
- Sorry, registering a new user failed HOT 1
- Support downloading/importing Bash History from bashhub cloud HOT 2
- Docker hub builds not matching HOT 1
- Testing
- Request build/docker image for arm32v7 HOT 2
- Provide guidance on Bashhub credentials HOT 2
- Feature request: Support G-Suite/LDAP/SSO for login HOT 1
- Make simple search cap-insensitive by default HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bashhub-server.