{"id":19449740,"url":"https://github.com/metakgp/leprechaun","last_synced_at":"2026-01-11T03:42:01.341Z","repository":{"id":57611864,"uuid":"116171578","full_name":"metakgp/leprechaun","owner":"metakgp","description":"[DEPRECATED, NEW HEIMDALL SERVES SIMILAR PURPOSE] Connect an email ID to your IIT KGP roll number!","archived":true,"fork":false,"pushed_at":"2020-11-07T15:55:25.000Z","size":1062,"stargazers_count":16,"open_issues_count":6,"forks_count":3,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-13T23:21:19.141Z","etag":null,"topics":["authentication","erp","iit","kharagpur","metakgp"],"latest_commit_sha":null,"homepage":"https://github.com/metakgp/heimdall","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/metakgp.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-03T19:00:57.000Z","updated_at":"2024-06-19T15:42:01.000Z","dependencies_parsed_at":"2022-09-02T12:20:36.378Z","dependency_job_id":null,"html_url":"https://github.com/metakgp/leprechaun","commit_stats":null,"previous_names":["icyflame/leprechaun"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metakgp%2Fleprechaun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metakgp%2Fleprechaun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metakgp%2Fleprechaun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metakgp%2Fleprechaun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metakgp","download_url":"https://codeload.github.com/metakgp/leprechaun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250747973,"owners_count":21480763,"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","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":["authentication","erp","iit","kharagpur","metakgp"],"created_at":"2024-11-10T16:33:38.023Z","updated_at":"2025-04-25T03:31:57.394Z","avatar_url":"https://github.com/metakgp.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Leprechaun\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/icyflame/leprechaun)](https://goreportcard.com/report/github.com/icyflame/leprechaun)\n\u003e Connect an email ID to your IIT KGP roll number!\n\n## TOC\n- [Public API](#public-api)\n- [Development](#development)\n- [Origin](#origin)\n- [Etymology](#etymology)\n- [TODO](#todo)\n- [License](#license)\n\n## Public API\n\n**Note:** The public API can be accessed only by a few applications right now.\nIf you would like to use the API, contact one of the\n[maintainers](https://wiki.metakgp.org/w/Metakgp:Governance#Current_maintainers)\non [Metakgp Slack](https://metakgp.slack.com).\n\n**Authentication:** In your request, add an `Authorization` header. The\nvalue of the header should be `Bearer \u003cTOKEN\u003e`. You can get this token from one\nof the maintainers.\n\n**Endpoint:** `GET /get/{input_type}/{input}`\n\nValid values of `input_type`:\n\n1. `roll`\n1. `email`\n\nExamples:\n\n1. `GET /get/roll/12CS40067`\n1. `GET /get/email/bob@example.com`\n\n**Response:** \n\n- 401 if request is unauthorized\n- 404 if no record with the given input_type and input could be find\n- 200 if a record was found. The response will contain a JSON object with the following keys set:\n\n\t1. `roll` - Roll number of the user\n\t1. `email` - Email of the user\n\t1. `authenticated` - Timestamp that the authentication was completed in [RFC3339][1] format\n\n**Curl Verbose:**\n\n```sh\n$ curl -vvv -H \"Authorization: Bearer abcd\" https://leprechaun.metakgp.org/get/roll/12CS40067\n*   Trying 172.16.2.30...\n* Connected to 172.16.2.30 (172.16.2.30) port 8080 (#0)\n* Establish HTTP proxy tunnel to leprechaun.metakgp.org:443\n\u003e CONNECT leprechaun.metakgp.org:443 HTTP/1.1\n\u003e Host: leprechaun.metakgp.org:443\n\u003e User-Agent: curl/7.47.0\n\u003e Proxy-Connection: Keep-Alive\n\u003e\n\u003c HTTP/1.1 200 Connection Established\n\u003c Proxy-Agent: IWSS\n\u003c Date: Wed, 14 Feb 2018 09:51:48 GMT\n\u003c\n* Proxy replied OK to CONNECT request\n* found 148 certificates in /etc/ssl/certs/ca-certificates.crt\n* found 597 certificates in /etc/ssl/certs\n* ALPN, offering http/1.1\n* SSL connection using TLS1.2 / ECDHE_ECDSA_AES_128_GCM_SHA256\n* ...\n* ALPN, server accepted to use http/1.1\n\u003e GET /get/roll/12CS40067 HTTP/1.1\n\u003e Host: leprechaun.metakgp.org\n\u003e User-Agent: curl/7.47.0\n\u003e Accept: */*\n\u003e Authorization: Bearer abcd\n\u003e\n\u003c HTTP/1.1 200 OK\n\u003c Date: Wed, 14 Feb 2018 09:51:43 GMT\n\u003c Content-Type: application/json; charset=utf-8\n\u003c Content-Length: 59\n\u003c Connection: keep-alive\n\u003c Via: 1.1 vegur\n\u003c Server: cloudflare\n\u003c\n* Connection #0 to host 172.16.2.30 left intact\n{\"authenticated\":\"2018-01-04T13:12:50Z\",\"email\":\"bob@example.com\",\"roll\":\"12CS40067\"}\n```\n\n## Development\n\nTo run this locally:\n\n```sh\n$ go get github.com/icyflame/leprechaun\n$ cd $GOPATH/github.com/icyflame/leprechaun\n$ npm install -g gulp-cli\n$ npm install\n$ gulp\n$ go build\n$ cp .env.template .env\n# populate .env with the appropriate values\n$ PORT=8080 ./leprechaun\n```\n\nYou need to have MongoDB, Node.js, npm, Golang and gulp installed.\n\nTo populate the `.env` file, you need an active Sendgrid account.\n\nTo push this to Heroku, run the build script. Note that this is run inside\nHeroku under a GoLang buildpack. But before `go build`, we need to run `gulp`\nand create all the HTML and Template assets. The build script takes care of\nthis. (It switches to a different branch, deletes `dist/` from `gitignore`, runs\n`gulp`, adds everything, commits, pushes to Heroku and then, switches back to\n`master`)\n\n## Origin\n\n[Vikrant Varma](https://github.com/amrav) posted the [Idea\ndocument](https://paper.dropbox.com/doc/Leprechaun-BK0eQTGGvMLbVoor4L0dJ) for\nLeprechaun to the Metakgp Slack on 3rd January, 2018.\n\nLeprechaun was envisioned as an authentication service which will associate an\nemail address to an IIT Kharagpur Roll Number, using proof-of-control over the\nERP account. Since only students of IIT Kharagpur have active ERP IIT KGP\naccounts, this service can only be used by students of IIT Kharagpur.\n\nThis service ensures that students don't have to share their ERP credentials\nwith any application where they would like to authenticate themselves as\nstudents of IIT Kharagpur.\n\nThe authentication flow goes like this:\n\n1. User visits Leprechaun and asserts their roll number and email address. The\n   user is given a unique verification key (say `VERIFIER_TOKEN`) and a unique\n   link to visit.\n2. The user is shown a verification key which they must add to one of their\n   secret question text in ERP.\n\n   **Eg:**  \n   Old Question: _What was the name of your first pet?_  \n   New Question: _What was the name of your first pet? (VERIFIER_TOKEN)_ \n\n   The question can be changed in the ERP using the Forgot password section on the\n   IIT KGP ERP.\n\n   Once they have changed the text of the question, they can visit the link\n   provided in step 1.\n3. Leprechaun will make requests to ERP IIT KGP to check whether one of the\n   secret questions tied to the user's roll number has the verification key in\n   it's text.\n4. If step 3 is not successful, it tells the user to check their association.\n5. If step 3 is successful, **Authentication Step 1** is now complete. The service\n   has verified that the user has control over the roll number's ERP account.\n   Now, a verification email is sent to the email address entered in step 1.\n6. The user visits their inbox and clicks on the link in this verification\n   email.\n7. This leads them back to the service which will verify the token embedded in\n   this verification link. If verified succesfully, **Authentication Step 2** is\n   complete! _The roll number and email supplied by the user in step 1 are now\n   associated in Leprechaun's DB_\n\nServices (like [Metakgp Dashboard](https://github.com/metakgp/dashboard-beta))\ncan use Leprechaun using the [Public API](#public-api) to find the email address\nthat a supplied roll number is associated with. This email address can be used\nas a proxy for the user's roll number.\n\n## Etymology\n\n\u003cimg src=\"public/leprechaun.png\" height=\"600\" /\u003e\n\nLeprechaun\n\n_n._ a mischievous elf of Irish folklore usually believed to reveal the\nhiding place of treasure if caught\n\n## TODO\n\nSearch for the strings `TODO` and `ENHANCE` in the codebase.\n\n## License\n\nCode licensed under MIT.\n\nMetakgp 2018\n\n[1]: https://tools.ietf.org/html/rfc3339\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetakgp%2Fleprechaun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetakgp%2Fleprechaun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetakgp%2Fleprechaun/lists"}