Exemple #1
0
import passlib
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm.exc import NoResultFound
# from flask import redirect, url_for, make_response
from flask.ext.restplus import Resource
from flask.ext.mail import Message

from auths import get_auth_url, get_username
from models import User
from extensions import db, sv
from utils import decode_validate_token
from cutils import ExtraApi


api = ExtraApi(version='1.0',
               title='Vira-lata',
               description='An authentication microservice.')

api.update_parser_arguments({
    'username': {
        'location': 'json',
        'help': 'The username.',
    },
    'password': {
        'location': 'json',
        'help': 'The password.',
    },
    'new_password': {
        'location': 'json',
        'help': 'A new password, when changing the current one.',
    },
Exemple #2
0
import bleach
from sqlalchemy import desc
from sqlalchemy.orm.exc import NoResultFound
from flask.ext.restplus import Resource
from flask.ext.mail import Message
from itsdangerous import BadSignature, SignatureExpired

from viralata.utils import decode_token
from cutils import date_to_json, paginate, ExtraApi

from models import Comment, Thread, Author
from extensions import db, sv


api = ExtraApi(version='1.0',
               title='Tagarela!',
               description='A commenting microservice. All non-get operations '
               'require a micro token.')

api.update_parser_arguments({
    'text': {
        'location': 'json',
        'help': 'The text for the comment.',
    },
    'vote': {
        'location': 'json',
        'type': bool,
        'help': 'Use "true" for a upvote, "false" for a downvote.',
    },
})

Exemple #3
0
import arrow
import bleach
from sqlalchemy import desc
from sqlalchemy.orm import joinedload
from sqlalchemy.orm.exc import NoResultFound
from flask.ext.restplus import Resource

from viralata.utils import decode_token
from cutils import paginate, ExtraApi

from models import Orgao, Author, PrePedido, Pedido, Message, Keyword
from extensions import db, sv


api = ExtraApi(version='1.0',
               title='EsicLivre',
               description='A microservice for eSIC interaction. All non-get '
               'operations require a micro token.')

api.update_parser_arguments({
    'text': {
        'location': 'json',
        'help': 'The text for the pedido.',
    },
    'orgao': {
        'location': 'json',
        'help': 'Orgao that should receive the pedido.',
    },
    'keywords': {
        'location': 'json',
        'type': list,
        'help': 'Keywords to tag the pedido.',