Skip to content

agorushkin/oauth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Small http server library

⚠️ It should be noted that the project is in the early stages of development and is not ready for use in production. The API may change in the future.

πŸ“– About

This is a small practice project I started to learn the intricacies of backend development. It includes features such as user sign-up, token management, token refreshes, and token grants. The aim is to create a simple yet functional HTTP server that handles authentication and authorization effectively. Feedback and contributions are welcome as I continue to refine and expand this project.

USE IN PRODUCTION IS STRONGLY DISCOURAGED, BUT IF YOU DO WANT TO, USE AT YOUR OWN DISCRETION

πŸ“¦ Installation

Setting Up

It is worth noting that you can import your own JWK crypto key and store it in key.json if you wish, otherwise a new key will be generated and stored there.

All the user data that is stored after the program is ran, can be found in data.json.

Running

In order to run the project, use deno -RWN main.ts

Configuration

The default port of the program is 8080, if you wish to change it, you are able to do it through editing config/config.json

SSL

The program supports SSL out of the box, by default the values in config are set to "", as long as length on both items ("cert" and "key" is 0, it won't use tls). If you want to use a custom certificate authority, run the program with the --cert path/to/CA.pem flag.

πŸ“‚ Project Structure

.
β”œβ”€β”€ config
β”‚   └── config.json
β”œβ”€β”€ deno.json
β”œβ”€β”€ deno.lock
β”œβ”€β”€ lib
β”‚   β”œβ”€β”€ actions
β”‚   β”‚   β”œβ”€β”€ exec.ts
β”‚   β”‚   β”œβ”€β”€ read.ts
β”‚   β”‚   └── write.ts
β”‚   β”œβ”€β”€ auth
β”‚   β”‚   β”œβ”€β”€ scope.ts
β”‚   β”‚   └── token.ts
β”‚   β”œβ”€β”€ crypto
β”‚   β”‚   β”œβ”€β”€ code.ts
β”‚   β”‚   β”œβ”€β”€ hash.ts
β”‚   β”‚   β”œβ”€β”€ key.ts
β”‚   β”‚   β”œβ”€β”€ salt.ts
β”‚   β”‚   └── ulid.ts
β”‚   β”œβ”€β”€ data
β”‚   β”‚   β”œβ”€β”€ constants.ts
β”‚   β”‚   β”œβ”€β”€ schema.ts
β”‚   β”‚   └── types.ts
β”‚   β”œβ”€β”€ db.ts
β”‚   β”œβ”€β”€ routes
β”‚   β”‚   β”œβ”€β”€ authenticate.ts
β”‚   β”‚   β”œβ”€β”€ exchange.ts
β”‚   β”‚   β”œβ”€β”€ grant.ts
β”‚   β”‚   β”œβ”€β”€ not_found.ts
β”‚   β”‚   β”œβ”€β”€ refresh.ts
β”‚   β”‚   β”œβ”€β”€ resource.ts
β”‚   β”‚   β”œβ”€β”€ sign_in.ts
β”‚   β”‚   β”œβ”€β”€ sign_up.ts
β”‚   β”‚   └── status.ts
β”‚   └── utils
β”‚       β”œβ”€β”€ elapse.ts
β”‚       β”œβ”€β”€ intercept.ts
β”‚       β”œβ”€β”€ match.ts
β”‚       β”œβ”€β”€ response.ts
β”‚       └── result.ts
β”œβ”€β”€ main.ts
└── README.md

About

πŸ” oauth server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published