.gitignore & more

This commit is contained in:
Nico Schottelius 2020-02-20 16:55:01 +01:00
parent e472d20ae0
commit 254429db55
5 changed files with 47 additions and 1 deletions

View file

@ -5,6 +5,23 @@ import json
import logging import logging
from functools import wraps from functools import wraps
from ldaptest import is_valid_ldap_user
def authenticate(func):
@wraps(func)
def wrapper(*args, **kwargs):
if not getattr(func, 'authenticated', True):
return func(*args, **kwargs)
# pass in username/password !
acct = basic_authentication() # custom account lookup function
if acct:
return func(*args, **kwargs)
flask_restful.abort(401)
return wrapper
def readable_errors(func): def readable_errors(func):
@wraps(func) @wraps(func)
def wrapper(*args, **kwargs): def wrapper(*args, **kwargs):
@ -147,6 +164,22 @@ See https://redmine.ungleich.ch/issues/7747?
] ]
} }
) )
self.products.append(
{ "name": "ipv6-vpn-with-/48",
"description": """
An IPv6 VPN with a /48 network included.
""",
"uuid": "fe5753f8-6fe1-4dc4-9b73-7b803de4c597",
"recurring": True,
"recurring_time_frame": "per_year",
"features": [
{ "name": "vpn",
"price_one_time": 0,
"price_recurring": 120
}
]
}
)
@staticmethod @staticmethod

0
hack.org Normal file
View file

1
nicohack202002/uncloud/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
db.sqlite3

View file

@ -1,3 +1,13 @@
* python requirements (nicohack202002)
django djangorestframework
* VPN case
** put on /orders with uuid
** register cc
* CC
** TODO check whether we can register or not at stripe
* membership
** required for "smaller" / "shorter" products
* TODO Membership missing * TODO Membership missing
* Flows to be implemented - see https://redmine.ungleich.ch/issues/7609 * Flows to be implemented - see https://redmine.ungleich.ch/issues/7609
** Membership ** Membership

View file

@ -33,7 +33,6 @@ class ListProducts(Resource):
logger.debug('Products = {}'.format(prod_dict)) logger.debug('Products = {}'.format(prod_dict))
return prod_dict, 200 return prod_dict, 200
class AddProduct(Resource): class AddProduct(Resource):
@staticmethod @staticmethod
def post(): def post():
@ -68,6 +67,9 @@ class AddProduct(Resource):
else: else:
return make_return_message('Product updated.') return make_return_message('Product updated.')
################################################################################
# Nico-ok-marker
class UserRegisterPayment(Resource): class UserRegisterPayment(Resource):
@staticmethod @staticmethod