mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-01-12 03:51:21 -05:00
* initial oidc implementation * add dynamic scheme * e2e test setup * add caching * fix * try this * add libldap-2.5 to runtime dependencies (#2849) * New translations en-us.json (Norwegian) (#2851) * New Crowdin updates (#2855) * New translations en-us.json (Italian) * New translations en-us.json (Norwegian) * New translations en-us.json (Portuguese) * fix * remove cache * cache yarn deps * cache docker image * cleanup action * lint * fix tests * remove not needed variables * run code gen * fix tests * add docs * move code into custom scheme * remove unneeded type * fix oidc admin * add more tests * add better spacing on login page * create auth providers * clean up testing stuff * type fixes * add OIDC auth method to postgres enum * add option to bypass login screen and go directly to iDP * remove check so we can fallback to another auth method oauth fails * Add provider name to be shown at the login screen * add new properties to admin about api * fix spec * add a prompt to change auth method when changing password * Create new auth section. Add more info on auth methods * update docs * run ruff * update docs * format * docs gen * formatting * initialize logger in class * mypy type fixes * docs gen * add models to get proper fields in docs and fix serialization * validate id token before using it * only request a mealie token on initial callback * remove unused method * fix unit tests * docs gen * check for valid idToken before getting token * add iss to mealie token * check to see if we already have a mealie token before getting one * fix lock file * update authlib * update lock file * add remember me environment variable * add user group setting to allow only certain groups to log in --------- Co-authored-by: Carter Mintey <cmintey8@gmail.com> Co-authored-by: Carter <35710697+cmintey@users.noreply.github.com>
46 lines
1.1 KiB
Python
46 lines
1.1 KiB
Python
from sqlite3 import IntegrityError
|
|
|
|
from mealie.lang.providers import Translator
|
|
|
|
|
|
class UnexpectedNone(Exception):
|
|
"""Exception raised when a value is None when it should not be."""
|
|
|
|
def __init__(self, message: str = "Unexpected None Value"):
|
|
self.message = message
|
|
super().__init__(self.message)
|
|
|
|
def __str__(self):
|
|
return f"{self.message}"
|
|
|
|
|
|
class PermissionDenied(Exception):
|
|
"""
|
|
This exception is raised when a user tries to access a resource that they do not have permission to access.
|
|
"""
|
|
|
|
pass
|
|
|
|
|
|
class NoEntryFound(Exception):
|
|
"""
|
|
This exception is raised when a user tries to access a resource that does not exist.
|
|
"""
|
|
|
|
pass
|
|
|
|
|
|
def mealie_registered_exceptions(t: Translator) -> dict:
|
|
"""
|
|
This function returns a dictionary of all the globally registered exceptions in the Mealie application.
|
|
"""
|
|
|
|
return {
|
|
PermissionDenied: t.t("exceptions.permission-denied"),
|
|
NoEntryFound: t.t("exceptions.no-entry-found"),
|
|
IntegrityError: t.t("exceptions.integrity-error"),
|
|
}
|
|
|
|
|
|
class UserLockedOut(Exception): ...
|