Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tendant/simple-idm
https://github.com/tendant/simple-idm
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/tendant/simple-idm
- Owner: tendant
- Created: 2024-05-13T21:37:05.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-11-06T09:38:34.000Z (about 2 months ago)
- Last Synced: 2024-11-06T10:50:40.354Z (about 2 months ago)
- Language: Go
- Size: 184 KB
- Stars: 0
- Watchers: 1
- Forks: 11
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sqlc installation
go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
# Testing commands
curl -i -X POST localhost:4000/api/users -d '{"email": "[email protected]"}' -H "Content-Type: application/json"
curl -i localhost:4000/api/users# Create database
CREATE Role idm WITH PASSWORD 'pwd';
CREATE DATABASE idm_db ENCODING 'UTF8' OWNER idm;
GRANT ALL PRIVILEGES ON DATABASE idm_db TO idm;
ALTER ROLE idm WITH LOGIN;
# Run Migraionmake migrate-up-idm
# Fix DatabaseALTER TABLE users OWNER TO idm;
# Insert users recordINSERT INTO users (username, name, password, email, created_by)
VALUES ('admin', 'admin', convert_to('pwd', 'UTF8'), '[email protected]', 'system');# Insert roles record
INSERT INTO roles (role_name, description)
VALUES ('admin', 'Administrator with full access');
# Insert user_roles recordselect * from users;
select * from roles;
INSERT INTO user_roles (user_uuid, role_uuid)
VALUES ('user-uuid-example-1234', 'role-uuid-example-5678');
# API Test Commands## Create User
curl -i -X POST localhost:4000/api/v4/user --data '{"name":"xyz", "email": "abc"}' --header "Content-Type: application/json"
## Login
curl -i -X POST localhost:4000/login --data '{"username":"admin", "password": "pwd"}' --header "Content-Type: application/json"