{"id":21513975,"url":"https://github.com/datasektionen/hodis","last_synced_at":"2025-10-08T12:49:59.390Z","repository":{"id":26101305,"uuid":"105144287","full_name":"datasektionen/hodis","owner":"datasektionen","description":"User lookup and information management system","archived":false,"fork":false,"pushed_at":"2023-11-09T19:09:08.000Z","size":3005,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-17T15:58:14.723Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://hodis.datasektionen.se","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datasektionen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-28T12:15:27.000Z","updated_at":"2024-09-18T21:40:21.000Z","dependencies_parsed_at":"2025-03-17T15:57:02.798Z","dependency_job_id":null,"html_url":"https://github.com/datasektionen/hodis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/datasektionen/hodis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datasektionen%2Fhodis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datasektionen%2Fhodis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datasektionen%2Fhodis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datasektionen%2Fhodis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datasektionen","download_url":"https://codeload.github.com/datasektionen/hodis/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datasektionen%2Fhodis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278948017,"owners_count":26073747,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T23:38:29.113Z","updated_at":"2025-10-08T12:49:59.330Z","avatar_url":"https://github.com/datasektionen.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hodis - User lookup system\n\n## API\n\n### GET /ping\n\nReturns \"Pong\". Can be used for health-checking of the service.\n\n### GET /users/:query\n\nSearches kthid, ugkthid and name for `:query`. Responds with a list of users. Example:\n\n```json\n[\n    {\n        \"ugKthid\": \"u1xxxxxx\",\n        \"uid\": \"tomten\",\n        \"cn\": \"Tomten Andersson (tomten)\",\n        \"mail\": \"tomten@kth.se\",\n        \"givenName\": \"Tomten\",\n        \"displayName\": \"Tomten Andersson\",\n        \"year\": 2018,\n        \"tag\":\"\"\n    },\n    {\n        \"ugKthid\": \"u1xxxxxx\",\n        \"uid\": \"tandfen\",\n        \"cn\": \"Tandfen Persson (tandfen)\",\n        \"mail\": \"tandfen@kth.se\",\n        \"givenName\": \"Tandfen\",\n        \"displayName\": \"Tandfen Persson\",\n        \"year\": 2017,\n        \"tag\":\"\"\n    }\n]\n```\n\n### GET /uid/:uid\n\nSearches kthid for `:uid`. Responds with exactly one user. Same format as above.\n\n### GET /ugkthid/:ugid\n\nSearches ugkthid for `:ugid`. Responds with exactly one user. Same format as above.\n\n### GET /tag/:tag\n\nSearches for the first user with the given `:tag`. Tags seem to have been an experimental feature that isn't used. Responds with exactly one user. Same format as above.\n\n### POST /uid/:uid\n\nUpdates a user. The user details can be specified either as a json body or as form fields. The format is the same as above.\n\nAuthentication is done by specifying an `api_key` or a `token`. The API key is a PLS API key and the token is a Login token. Users can modify their own profiles. If a user has the hodis.admin permission in PLS then they can modify other users profiles.\n\n## Environment variables\n\n| Variable      | Description                               | Example                               |\n|---------------|-------------------------------------------|---------------------------------------|\n| LOGIN_API_KEY | API key for the Login system.             | --                                    |\n| LOGIN_URL     | URL to the Login system.                  | https://login.datasektionen.se        |\n| PLS_URL       | URL to pls.                               | https://pls.datasektionen.se          |\n| LDAP_HOST     | hostname to kth:s ldap server.            | ldap.kth.se                           |\n| LDAP_PORT     | tcp to kth:s ldap server.                 | 389                                   |\n| DATABASE_URL  | A postgresql database url.                | postgres://postgres:password@db:5432/ |\n| GIN_MODE      | Should be set to \"release\" in production. | |\n\n## Dependency on other systems at Datasektionen\n\n- **Login**: Used to authenticate users before changing their profiles.\n- **PLS**: Used to check permissions before changing users profiles.\n\n## PLS permissions\n\n- hodis.admin: Allow API Keys or users to change other users profiles.\n\n## Production setup\n\nSet environment variables according to \"Environment variables\", install go, run `go build hodis.go` and start the server with `./hodis`.\n\n## Development setup\n\n`DATABASE_URL` should point to a postgresql database. You can start one with:\n```sh\ndocker run \\\n    --name hodis-db -p 5432:5432 -d \\\n    -e POSTGRES_PASSWORD=hodis \\\n    -e POSTGRES_DB=hodis \\\n    -e POSTGRES_USER=hodis \\\n    postgres\n```\nand use the following: `DATABASE_URL=postgres://hodis:hodis@localhost:5432/hodis?sslmode=disable`\n\nIf you're at KTH, ldap might just work (?). Otherwise, create a tcp tunnel through\nmjukglass using something like: `ssh mjukglass -L 33389:ldap.kth.se:389` and set\n`LDAP_HOST` to localhost and `LDAP_PORT` to 33389.\n\nTo not use pls for verifying api keys, you can set `PLS_URL` to `true` or\n`false` to accept or reject any given api keys.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatasektionen%2Fhodis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatasektionen%2Fhodis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatasektionen%2Fhodis/lists"}