Skip to content

agorushkin/oauth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 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.

πŸ“¦ Installation

Setting Up

After copying the repository, run the setup.sh to create required foulders. It is worth noting that you can import your own JWK crypto key and store it in keys/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 lib/data/data.json.

Running

In order to run the project, use deno run --allow-read --allow-write --allow-net 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 lib/config/config.json

SSL

The program doesn't support SSL out of the box, but it is really easy to add by modifying the Server.listen call in lib/main.ts to include the files. If you want to use a custom certificate authority, run the program with the --cert path/to/CA.pem flag.

πŸ“‚ Project Structure

.
β”œβ”€β”€ README.md
β”œβ”€β”€ deno.json
β”œβ”€β”€ deno.lock
β”œβ”€β”€ key
β”œβ”€β”€ lib
β”‚   β”œβ”€β”€ config
β”‚   β”‚   └── config.json
β”‚   β”œβ”€β”€ data
β”‚   β”‚   β”œβ”€β”€ consts.ts
β”‚   β”‚   β”œβ”€β”€ data.json
β”‚   β”‚   β”œβ”€β”€ schema.ts
β”‚   β”‚   └── types.ts
β”‚   β”œβ”€β”€ main.ts
β”‚   β”œβ”€β”€ routes
β”‚   β”‚   β”œβ”€β”€ authorize.ts
β”‚   β”‚   β”œβ”€β”€ exchange.ts
β”‚   β”‚   β”œβ”€β”€ grant.ts
β”‚   β”‚   β”œβ”€β”€ not-found.ts
β”‚   β”‚   β”œβ”€β”€ refresh.ts
β”‚   β”‚   β”œβ”€β”€ resource.ts
β”‚   β”‚   β”œβ”€β”€ sign-in.ts
β”‚   β”‚   β”œβ”€β”€ sign-up.ts
β”‚   β”‚   └── status.ts
β”‚   └── src
β”‚       β”œβ”€β”€ actions
β”‚       β”‚   β”œβ”€β”€ exec.ts
β”‚       β”‚   β”œβ”€β”€ read.ts
β”‚       β”‚   └── write.ts
β”‚       β”œβ”€β”€ auth
β”‚       β”‚   β”œβ”€β”€ scope.ts
β”‚       β”‚   └── token.ts
β”‚       β”œβ”€β”€ crypto
β”‚       β”‚   β”œβ”€β”€ code.ts
β”‚       β”‚   β”œβ”€β”€ hash.ts
β”‚       β”‚   β”œβ”€β”€ key.ts
β”‚       β”‚   β”œβ”€β”€ salt.ts
β”‚       β”‚   └── ulid.ts
β”‚       β”œβ”€β”€ db.ts
β”‚       └── util
β”‚           β”œβ”€β”€ guard.ts
β”‚           β”œβ”€β”€ match.ts
β”‚           └── response.ts
β”œβ”€β”€ main.ts
└── setup.sh

About

πŸ” oauth server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published