-
How do you manage user authentication in martin? I want only certain users to see some data. does anyone have any suggestions what kind of middlaware would be good on martin? I want to build web application with vue-3, postgis and martin. If I check user and token info with function like below(I create user table in same database), Do you think it is good practice? or Should I put Martin behind fastapi or express to check user authentication?
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
I can think of two ways to do this - either introduce a new authentication proxy around Martin, and once the user is authenticated, pass validated value to the database as you describe, or, Martin can be used as a library, and you can introduce your own endpoint that simply uses Martin's internal logic. |
Beta Was this translation helpful? Give feedback.
-
Here's a functional example of a Docker-based solution integrating PostgreSQL/Django/Nginx/Certbot.
Note Macvlan allows Nginx container to have a different IP and MAC Address from the host on the same machine, while the other containers have addresses within the container and communicate using a separate bridge network. Additionally, port 80 traffic is redirected to port 443 in Nginx for secure communication. Port 5442 is expose on host to access the db. Security Note: Just to be clear, I'm not a security expert, and this is just the way I've approached it. NGINX configuration :
The important part is :
and
DAJNGO URL :
DJANGO VIEW :
DOCKER-COMPOSE yaml
The access to martin in the json style file is not on :3000 port anymore but in /martin
|
Beta Was this translation helpful? Give feedback.
I can think of two ways to do this - either introduce a new authentication proxy around Martin, and once the user is authenticated, pass validated value to the database as you describe, or, Martin can be used as a library, and you can introduce your own endpoint that simply uses Martin's internal logic.