Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/datasektionen/zfinger

A replacement for xfinger
https://github.com/datasektionen/zfinger

Last synced: about 2 months ago
JSON representation

A replacement for xfinger

Awesome Lists containing this project

README

        

# zfinger
React app that talks to a RESTful-ish API written in Python/Flask.

API endpoints:

| Path | Method | Requires Log-in | Result |
| ----- | ----- | ----- | ----- |
| `/` | `GET` | Yes | Displays index/searchbar |
| `/me` | `GET` | Yes | Displays an object with kth `uid` and wheter the user has uploaded an image to `s3`(`personal`) |
| `/user//image` | `GET` | No | Image for user, redirects to `s3` |
| `/user//image` | `POST` | Yes | Uploads image for user to `s3` |
| `/user//image` | `DELETE` | Yes | Deletes image for user from `s3` |
| `/user//image/` | `GET` | No | Resized image for user |
| `/users/` | `GET`| No | Redirects to `hodis`, quering all information, displaying all matching as objects in an array |
| `/ugkthid/` | `GET` | No | Redirects to `hodis`, displaying information of `ugKthid` as an object |
| `/user/` | `GET`,`POST` | No | Redirects to `hodis`, displaying information of `uid` as an object |

If log-in is required, user will be redirected to `login.kth.se` if not already.

Information displayed in `hodis` is `ugKthid`,`uid`,`on`,`mail`,`givenName`,`displayName`,`year` and`tag`.

## How to run
1. Define environment variables in `.env`
1. `pipenv install`
1. `pipenv shell`
1. `flask run`

## Environment variables
Required environment variables:
```
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
LOGIN_API_KEY=

## Optional
S3_BUCKET=zfinger
HODIS_HOST=https://hodis.datasektionen.se
LOGIN_API_URL=https://login.datasektionen.se
LOGIN_FRONTEND_URL=https://login.datasektionen.se
```