core, internal, packages: fix British spellings flagged by cspell (#22819)

* core, internal, packages: fix British spellings flagged by cspell

Apply American spellings in Python docstrings/comments, Go log messages, a Rust doc comment, and a template comment (behaviour->behavior, initialise->initialize, finalise->finalize, etc.). Part of enabling cspell's British-spelling rule; the rule itself lands in a separate PR once all areas are clean.

Co-Authored-By: Playpen Agent <279763771+playpen-agent@users.noreply.github.com>

* gen

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Playpen Agent <279763771+playpen-agent@users.noreply.github.com>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Teffen Ellis
2026-06-08 14:55:31 +02:00
committed by GitHub
parent 54595de4b9
commit 5727ae4271
22 changed files with 25 additions and 25 deletions
+1 -1
View File
@@ -12,7 +12,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
{# Darkreader breaks the site regardless of theme as its not compatible with webcomponents, and we default to a dark theme based on preferred colour-scheme #} {# Darkreader breaks the site regardless of theme as its not compatible with webcomponents, and we default to a dark theme based on preferred color-scheme #}
<meta name="darkreader-lock"> <meta name="darkreader-lock">
<title>{% block title %}{% trans title|default:brand.branding_title %}{% endblock %}</title> <title>{% block title %}{% trans title|default:brand.branding_title %}{% endblock %}</title>
<link rel="icon" href="{{ brand.branding_favicon_url }}"> <link rel="icon" href="{{ brand.branding_favicon_url }}">
+1 -1
View File
@@ -196,7 +196,7 @@ class FlowExecutorView(APIView):
return self.handle_invalid_flow(exc) return self.handle_invalid_flow(exc)
except EmptyFlowException as exc: except EmptyFlowException as exc:
self._logger.warning("f(exec): Flow is empty", exc=exc) self._logger.warning("f(exec): Flow is empty", exc=exc)
# To match behaviour with loading an empty flow plan from cache, # To match behavior with loading an empty flow plan from cache,
# we don't show an error message here, but rather call _flow_done() # we don't show an error message here, but rather call _flow_done()
return self._flow_done() return self._flow_done()
# We don't save the Plan after getting the next stage # We don't save the Plan after getting the next stage
+1 -1
View File
@@ -59,7 +59,7 @@ def avatar_mode_gravatar(user: User, mode: str) -> str | None:
def generate_colors(text: str) -> tuple[str, str]: def generate_colors(text: str) -> tuple[str, str]:
"""Generate colours based on `text`""" """Generate colors based on `text`"""
color = ( color = (
int(md5(text.lower().encode("utf-8"), usedforsecurity=False).hexdigest(), 16) % 0xFFFFFF int(md5(text.lower().encode("utf-8"), usedforsecurity=False).hexdigest(), 16) % 0xFFFFFF
) # nosec ) # nosec
+1 -1
View File
@@ -91,7 +91,7 @@ class LDAPOutpostConfigSerializer(ModelSerializer):
unbind_flow_slug = SerializerMethodField() unbind_flow_slug = SerializerMethodField()
def get_application_slug(self, instance: LDAPProvider) -> str: def get_application_slug(self, instance: LDAPProvider) -> str:
"""Prioritise backchannel slug over direct application slug""" """Prioritize backchannel slug over direct application slug"""
if instance.backchannel_application: if instance.backchannel_application:
return instance.backchannel_application.slug return instance.backchannel_application.slug
return instance.application.slug return instance.application.slug
+1 -1
View File
@@ -22,7 +22,7 @@ class ObjectPermissions(DjangoObjectPermissions):
lookup = getattr(view, "lookup_url_kwarg", None) or getattr(view, "lookup_field", None) lookup = getattr(view, "lookup_url_kwarg", None) or getattr(view, "lookup_field", None)
if lookup and lookup in view.kwargs: if lookup and lookup in view.kwargs:
return True return True
# Legacy behaviour: # Legacy behavior:
# Allow creation of objects even without explicit permission # Allow creation of objects even without explicit permission
queryset = self._queryset(view) queryset = self._queryset(view)
required_perms = self.get_required_permissions(request.method, queryset.model) required_perms = self.get_required_permissions(request.method, queryset.model)
+1 -1
View File
@@ -76,7 +76,7 @@ class GitHubType(SourceType):
chosen_email = info.get("email") chosen_email = info.get("email")
if not chosen_email: if not chosen_email:
# The GitHub Userprofile API only returns an email address if the profile # The GitHub Userprofile API only returns an email address if the profile
# has a public email address set (despite us asking for user:email, this behaviour # has a public email address set (despite us asking for user:email, this behavior
# doesn't change.). So we fetch all the user's email addresses # doesn't change.). So we fetch all the user's email addresses
emails = client.get_github_emails(token) emails = client.get_github_emails(token)
for email in emails: for email in emails:
+1 -1
View File
@@ -291,7 +291,7 @@ class VerifyNotAllowed:
class ThrottlingMixin(models.Model): class ThrottlingMixin(models.Model):
""" """
Mixin class for models that want throttling behaviour. Mixin class for models that want throttling behavior.
This implements exponential back-off for verifying tokens. Subclasses must This implements exponential back-off for verifying tokens. Subclasses must
implement :meth:`get_throttle_factor`, and must use the implement :meth:`get_throttle_factor`, and must use the
+1 -1
View File
@@ -362,7 +362,7 @@ class AuthenticatorSMSStageTests(FlowTestCase):
class TestSMSDeviceThrottling(ThrottlingTestMixin, TestCase): class TestSMSDeviceThrottling(ThrottlingTestMixin, TestCase):
"""Test ThrottlingMixin behaviour on SMSDevice.verify_token""" """Test ThrottlingMixin behavior on SMSDevice.verify_token"""
def setUp(self): def setUp(self):
super().setUp() super().setUp()
+1 -1
View File
@@ -18,7 +18,7 @@ PLAN_CONTEXT_INVITATION = "invitation"
class InvitationStageView(StageView): class InvitationStageView(StageView):
"""Finalise Authentication flow by logging the user in""" """Finalize Authentication flow by logging the user in"""
def get_token(self) -> str | None: def get_token(self) -> str | None:
"""Get token from saved get-arguments or prompt_data""" """Get token from saved get-arguments or prompt_data"""
+1 -1
View File
@@ -10,7 +10,7 @@ from authentik.flows.stage import StageView
class UserDeleteStageView(StageView): class UserDeleteStageView(StageView):
"""Finalise unenrollment flow by deleting the user object.""" """Finalize unenrollment flow by deleting the user object."""
def dispatch(self, request: HttpRequest) -> HttpResponse: def dispatch(self, request: HttpRequest) -> HttpResponse:
"""Delete currently pending user""" """Delete currently pending user"""
+1 -1
View File
@@ -50,7 +50,7 @@ class UserLoginChallengeResponse(ChallengeResponse):
class UserLoginStageView(ChallengeStageView): class UserLoginStageView(ChallengeStageView):
"""Finalise Authentication flow by logging the user in""" """Finalize Authentication flow by logging the user in"""
response_class = UserLoginChallengeResponse response_class = UserLoginChallengeResponse
+1 -1
View File
@@ -30,7 +30,7 @@ PLAN_CONTEXT_USER_PATH = "user_path"
class UserWriteStageView(StageView): class UserWriteStageView(StageView):
"""Finalise Enrollment flow by creating a user object.""" """Finalize Enrollment flow by creating a user object."""
def __init__(self, executor: FlowExecutorView, **kwargs): def __init__(self, executor: FlowExecutorView, **kwargs):
super().__init__(executor, **kwargs) super().__init__(executor, **kwargs)
+1 -1
View File
@@ -55,7 +55,7 @@ type APIController struct {
instanceUUID uuid.UUID instanceUUID uuid.UUID
} }
// NewAPIController initialise new API Controller instance from URL and API token // NewAPIController initialize new API Controller instance from URL and API token
func NewAPIController(akURL url.URL, token string) *APIController { func NewAPIController(akURL url.URL, token string) *APIController {
rsp := sentry.StartSpan(context.Background(), "authentik.outposts.init") rsp := sentry.StartSpan(context.Background(), "authentik.outposts.init")
log := log.WithField("logger", "authentik.outpost.ak-api-controller") log := log.WithField("logger", "authentik.outpost.ak-api-controller")
+1 -1
View File
@@ -60,7 +60,7 @@ func doGlobalSetup(outpost api.Outpost, globalConfig *api.Config) {
}, },
}) })
if err != nil { if err != nil {
l.WithField("env", globalConfig.ErrorReporting.Environment).WithError(err).Warning("Failed to initialise sentry") l.WithField("env", globalConfig.ErrorReporting.Environment).WithError(err).Warning("Failed to initialize sentry")
} }
} }
} }
+1 -1
View File
@@ -24,7 +24,7 @@ func NewDirectBinder(si server.LDAPServerInstance) *DirectBinder {
si: si, si: si,
log: log.WithField("logger", "authentik.outpost.ldap.binder.direct"), log: log.WithField("logger", "authentik.outpost.ldap.binder.direct"),
} }
db.log.Info("initialised direct binder") db.log.Info("initialized direct binder")
return db return db
} }
+2 -2
View File
@@ -32,14 +32,14 @@ func NewSessionBinder(si server.LDAPServerInstance, oldBinder bind.Binder) *Sess
if oldSb, ok := oldBinder.(*SessionBinder); ok { if oldSb, ok := oldBinder.(*SessionBinder); ok {
sb.DirectBinder = oldSb.DirectBinder sb.DirectBinder = oldSb.DirectBinder
sb.sessions = oldSb.sessions sb.sessions = oldSb.sessions
sb.log.Debug("re-initialised session binder") sb.log.Debug("re-initialized session binder")
return sb return sb
} }
} }
sb.sessions = ttlcache.New(ttlcache.WithDisableTouchOnHit[Credentials, ldap.LDAPResultCode]()) sb.sessions = ttlcache.New(ttlcache.WithDisableTouchOnHit[Credentials, ldap.LDAPResultCode]())
sb.DirectBinder = *direct.NewDirectBinder(si) sb.DirectBinder = *direct.NewDirectBinder(si)
go sb.sessions.Start() go sb.sessions.Start()
sb.log.Debug("initialised session binder") sb.log.Debug("initialized session binder")
return sb return sb
} }
@@ -42,12 +42,12 @@ func NewMemorySearcher(si server.LDAPServerInstance, existing search.Searcher) *
if ems, ok := existing.(*MemorySearcher); ok { if ems, ok := existing.(*MemorySearcher); ok {
ems.si = si ems.si = si
ems.fetch() ems.fetch()
ems.log.Debug("re-initialised memory searcher") ems.log.Debug("re-initialized memory searcher")
return ems return ems
} }
} }
ms.fetch() ms.fetch()
ms.log.Debug("initialised memory searcher") ms.log.Debug("initialized memory searcher")
return ms return ms
} }
+2 -2
View File
@@ -210,7 +210,7 @@ impl Arbiter {
/// Consumers listening on this must also listen on [`Arbiter::graceful_shutdown`], as only one /// Consumers listening on this must also listen on [`Arbiter::graceful_shutdown`], as only one
/// of those is set upon shutdown. /// of those is set upon shutdown.
/// ///
/// It is also possible to use [`Arbiter::shutdown`] when the behaviour is the same between a /// It is also possible to use [`Arbiter::shutdown`] when the behavior is the same between a
/// fast and a graceful shutdown. /// fast and a graceful shutdown.
pub fn fast_shutdown(&self) -> WaitForCancellationFuture<'_> { pub fn fast_shutdown(&self) -> WaitForCancellationFuture<'_> {
self.fast_shutdown.cancelled() self.fast_shutdown.cancelled()
@@ -221,7 +221,7 @@ impl Arbiter {
/// Consumers listening on this must also listen on [`Arbiter::fast_shutdown`], as only one /// Consumers listening on this must also listen on [`Arbiter::fast_shutdown`], as only one
/// of those is set upon shutdown. /// of those is set upon shutdown.
/// ///
/// It is also possible to use [`Arbiter::shutdown`] when the behaviour is the same between a /// It is also possible to use [`Arbiter::shutdown`] when the behavior is the same between a
/// fast and a graceful shutdown. /// fast and a graceful shutdown.
pub fn graceful_shutdown(&self) -> WaitForCancellationFuture<'_> { pub fn graceful_shutdown(&self) -> WaitForCancellationFuture<'_> {
self.graceful_shutdown.cancelled() self.graceful_shutdown.cancelled()
+1 -1
View File
@@ -28,7 +28,7 @@ type LDAPOutpostConfig struct {
BindFlowSlug string `json:"bind_flow_slug"` BindFlowSlug string `json:"bind_flow_slug"`
// Get slug for unbind flow, defaulting to brand's default flow. // Get slug for unbind flow, defaulting to brand's default flow.
UnbindFlowSlug NullableString `json:"unbind_flow_slug"` UnbindFlowSlug NullableString `json:"unbind_flow_slug"`
// Prioritise backchannel slug over direct application slug // Prioritize backchannel slug over direct application slug
ApplicationSlug string `json:"application_slug"` ApplicationSlug string `json:"application_slug"`
Certificate NullableString `json:"certificate,omitempty"` Certificate NullableString `json:"certificate,omitempty"`
TlsServerName *string `json:"tls_server_name,omitempty"` TlsServerName *string `json:"tls_server_name,omitempty"`
+1 -1
View File
@@ -25,7 +25,7 @@ pub struct LdapOutpostConfig {
/// Get slug for unbind flow, defaulting to brand's default flow. /// Get slug for unbind flow, defaulting to brand's default flow.
#[serde(rename = "unbind_flow_slug", deserialize_with = "Option::deserialize")] #[serde(rename = "unbind_flow_slug", deserialize_with = "Option::deserialize")]
pub unbind_flow_slug: Option<String>, pub unbind_flow_slug: Option<String>,
/// Prioritise backchannel slug over direct application slug /// Prioritize backchannel slug over direct application slug
#[serde(rename = "application_slug")] #[serde(rename = "application_slug")]
pub application_slug: String, pub application_slug: String,
#[serde( #[serde(
+1 -1
View File
@@ -52,7 +52,7 @@ export interface LDAPOutpostConfig {
*/ */
readonly unbindFlowSlug: string | null; readonly unbindFlowSlug: string | null;
/** /**
* Prioritise backchannel slug over direct application slug * Prioritize backchannel slug over direct application slug
* @type {string} * @type {string}
* @memberof LDAPOutpostConfig * @memberof LDAPOutpostConfig
*/ */
+1 -1
View File
@@ -41922,7 +41922,7 @@ components:
readOnly: true readOnly: true
application_slug: application_slug:
type: string type: string
description: Prioritise backchannel slug over direct application slug description: Prioritize backchannel slug over direct application slug
readOnly: true readOnly: true
certificate: certificate:
type: string type: string