MicroApi Secure is a small engine for creating application APIs based on Symfony packages, which is a development of MicroApi Core.
MIT License
MicroApi Secure is a small engine for creating application APIs based on Symfony packages, which is a development of MicroApi Core and contains security tools. Since MicroApi is based on the Symfony architecture, it can be developed to any level of complexity if desired. Forming your application based on this engine, you will always be sure that there is nothing superfluous in your code.
base
, json
and token
See also core features.
It's very simple! Just run these two commands:
composer create-project reiterus/microapi-secure folder && cd folder
make docker-start
That's all! Now your API app is available at http://localhost:8009
To get JWT-token just send http-request to endpoint. For example, /admin
.
To check/decode this token send request to jwt/decode
endpoint.
GET http://localhost:8009/jwt/decode
Authorization: Bearer some.jwt-token
JWT-token structure:
{
"iat": 1681036036,
"exp": 1681036336,
"sub": "[email protected]",
"user": {
"username": "admin",
"email": "[email protected]",
"roles": [
"ROLE_ADMIN"
]
}
}
# run command
docker-compose logs -ft api | grep MICROAPI
# get log info
MICROAPI: TOKEN_ACCESS: Invalid Access Token {"token":"wrong.token.manager"}
For the convenience of working with the project, there are several make-commands: local and for Docker.
Default response at /admin
endpoint
{
"page": "Admin Account",
"identifier": "admin",
"roles": [
"ROLE_ADMIN"
]
}
You can install the project in two ways
From packagist.org
composer create-project reiterus/microapi-secure
From GitHub repository
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/reiterus/microapi-secure.git"
}
]
}
This library is released under the MIT license.