meapi
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2020-12-06 02:44:35 +01:00
parent 50e3cfd8a5
commit 46d8615ca8
2 changed files with 16 additions and 1 deletions

View File

@ -15,7 +15,7 @@ from marshm import ma
from healthchecks import health_database_status
from resources import SignupApi, LoginApi, UsersApi, UserParameterApi, CreateIngestResource, CreateEncodeResource, \
CreateRestreamResource, ManipulateStreamResource, GetAllStreamResources, ModifyEncodeResource, \
ModifyIngressResource, ModifyRestreamResource, CoordModifyResource
ModifyIngressResource, ModifyRestreamResource, CoordModifyResource, MeApi
"""
Main Flask RESTful API
@ -51,6 +51,7 @@ jwtman.init_app(app)
api.add_resource(SignupApi, '/api/auth/signup')
api.add_resource(LoginApi, '/api/auth/login')
api.add_resource(MeApi, '/api/auth/me')
api.add_resource(UsersApi, '/api/users')
api.add_resource(UserParameterApi, '/api/users/<username>')
api.add_resource(CreateIngestResource, '/api/objects/streamerobjects/ingest')

View File

@ -99,6 +99,20 @@ class LoginApi(Resource):
return {'token': access_token}, 200
class MeApi(Resource):
"""
See: https://swagger.kmlabz.com/?urls.primaryName=videON%20Backend#/backend/logon
"""
usermetadataschema = UserMetadataSchema(many=False)
def post(self):
username = get_jwt_identity()
# username = "jozska"
user = VideonUser.query.filter_by(name=username).first_or_404()
return self.usermetadataschema.dump(user), 200
class UsersApi(Resource):
"""
See: https://swagger.kmlabz.com/?urls.primaryName=videON%20Backend#/backend/getall