Skip to content

Service for link shortening written in Python + FastAPI + SQLAlchemy + SQLModel

License

Notifications You must be signed in to change notification settings

pkeorley/py-shortify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

py-shortify

py-shortify — is a link shortening service that provides a secure API for creating and managing shortened links. The service uses authentication tokens for authorization, which guarantees protection of all creation, update, and deletion operations from unauthorized access.

All authentication tokens are securely hashed using the SHA-256 algorithm, which provides a reliable level of security in case of unauthorized access to data.

Users

GET /api/v1/users

Retrieves information about the authenticated user

Headers

Authorization: Bearer {BASE64}

Response

{
    "id": "{UUID}"
}

POST /api/v1/users

Creates a new user

Response

{
    "id": "{UUID}",
    "auth_token": "{BASE64}",
}

Shortlinks

GET /api/v1/shortlinks

Retrieves a list of all short links created by the users

Response

[
    {
        "id": "{TEXT}",
        "name": "{TEXT}",
        "url": "{TEXT}"
    }
]

GET /api/v1/shortlinks/{name}

Retrieves information about a specific short link by its name

Response

{
    "id": "{UUID}",
    "name": "{TEXT}",
    "url": "{TEXT}"
}

Shorten

POST /api/v1/shorten

Creates a new short link

Headers

Authorization: Bearer {AUTH_TOKEN}

Body

{
    "name": "{TEXT}",
    "url": "{TEXT}"
}

Response

{
    "id": "{UUID}"
}

About

Service for link shortening written in Python + FastAPI + SQLAlchemy + SQLModel

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages