initial commit

This commit is contained in:
ston1th 2022-08-21 14:28:32 +02:00
commit beb0a7adfd
4 changed files with 54 additions and 0 deletions

16
__init__.py Normal file
View file

@ -0,0 +1,16 @@
import requests
from radicale.auth import BaseAuth
PLUGIN_CONFIG_SCHEMA = {"auth": {
"goacc_url": {"value": "", "type": str}}}
class Auth(BaseAuth):
def __init__(self, configuration):
super().__init__(configuration.copy(PLUGIN_CONFIG_SCHEMA))
def login(self, login, password):
url = self.configuration.get("auth", "goacc_url")
r = requests.get(url+"/auth/basic", auth=(login, password))
if r.text == "ok\n":
return login
return ""