sources/plex: fix plex token being included in event log

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-12-03 18:37:40 +01:00
parent 572f6d4ea0
commit 8ddb62ed0f
2 changed files with 4 additions and 3 deletions

View File

@ -29,14 +29,15 @@ def check_plex_token(self: MonitoredTask, source_slug: int):
auth.get_user_info() auth.get_user_info()
self.set_status(TaskResult(TaskResultStatus.SUCCESSFUL, ["Plex token is valid."])) self.set_status(TaskResult(TaskResultStatus.SUCCESSFUL, ["Plex token is valid."]))
except RequestException as exc: except RequestException as exc:
error = exception_to_string(exc).replace(source.plex_token, "$PLEX_TOKEN")
self.set_status( self.set_status(
TaskResult( TaskResult(
TaskResultStatus.ERROR, TaskResultStatus.ERROR,
["Plex token is invalid/an error occurred:", exception_to_string(exc)], ["Plex token is invalid/an error occurred:", error],
) )
) )
Event.new( Event.new(
EventAction.CONFIGURATION_ERROR, EventAction.CONFIGURATION_ERROR,
message=f"Plex token invalid, please re-authenticate source.\n{str(exc)}", message=f"Plex token invalid, please re-authenticate source.\n{error}",
source=source, source=source,
).save() ).save()

View File

@ -18,7 +18,7 @@ This certificate is generated to be used as a default for all OAuth2/OIDC provid
This certificate can also be used for SAML Providers/Sources, just keep in mind that the certificate is only valid for a year. Some SAML applications require the certificate to be valid, so they might need to be rotated regularly. This certificate can also be used for SAML Providers/Sources, just keep in mind that the certificate is only valid for a year. Some SAML applications require the certificate to be valid, so they might need to be rotated regularly.
For SAML use-cases, you can generate a Certificate thats valid for longer than 1 year, on your own risk. For SAML use-cases, you can generate a Certificate that's valid for longer than 1 year, on your own risk.
## External certificates ## External certificates