diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index e1e74276..fac60bcd 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -36,11 +36,11 @@ log_info() { } if [ "$1" == "krill" ]; then - # Does the opreator want to use their own API token? If so they must + # Does the operator want to use their own API token? If so they must # supply the KRILL_AUTH_TOKEN env var. if [ "${KRILL_AUTH_TOKEN}" == "None" ]; then - # Generate a unique hard to guess authorisation token and export it - # so that the Krill daemon uses it (unless overriden by the Krill + # Generate a unique hard to guess authorization token and export it + # so that the Krill daemon uses it (unless overridden by the Krill # daemon config file). Only do this if the operator didn't already # supply a token when launching the Docker container. export KRILL_AUTH_TOKEN=$(uuidgen) diff --git a/src/commons/api/roas.rs b/src/commons/api/roas.rs index f59e2bb2..2df75d19 100644 --- a/src/commons/api/roas.rs +++ b/src/commons/api/roas.rs @@ -122,7 +122,7 @@ impl AsRef for RoaDefinition { /// on its resource certificates. /// /// Multiple updates are sent as a single delta, because it's important that -/// all authorisations for a given prefix are published together in order to +/// all authorizations for a given prefix are published together in order to /// avoid invalidating announcements. #[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] pub struct RoaDefinitionUpdates { @@ -423,10 +423,10 @@ pub enum AuthorizationFmtError { #[display(fmt = "Invalid asn in string: {}", _0)] Asn(String), - #[display(fmt = "Invalid authorisation string: {}", _0)] + #[display(fmt = "Invalid authorization string: {}", _0)] Auth(String), - #[display(fmt = "Invalid authorisation delta string: {}", _0)] + #[display(fmt = "Invalid authorization delta string: {}", _0)] Delta(String), } diff --git a/src/commons/bgp/roa_table.rs b/src/commons/bgp/roa_table.rs index b24f3ab2..cd71d546 100644 --- a/src/commons/bgp/roa_table.rs +++ b/src/commons/bgp/roa_table.rs @@ -165,7 +165,7 @@ impl fmt::Display for RoaTable { writeln!(f)?; writeln!(f, "\tDefinition: {}", roa.definition)?; writeln!(f)?; - writeln!(f, "\t\tAuthorises:")?; + writeln!(f, "\t\tAuthorizes:")?; for ann in roa.authorizes.iter() { writeln!(f, "\t\t{}", ann)?; } @@ -265,7 +265,7 @@ impl fmt::Display for RoaSummmaryEntry { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let state_str = match self.state { RoaSummaryState::Valid => "announcement 'valid'", - RoaSummaryState::InvalidAsn => "announcement 'invalid': unauthorised asn", + RoaSummaryState::InvalidAsn => "announcement 'invalid': unauthorized asn", RoaSummaryState::InvalidLength => "announcement 'invalid': more specific than allowed", RoaSummaryState::NotFound => "announcement 'not found': not covered by your ROAs", RoaSummaryState::Stale => { diff --git a/src/commons/error.rs b/src/commons/error.rs index b20950c6..7d38e79d 100644 --- a/src/commons/error.rs +++ b/src/commons/error.rs @@ -179,7 +179,7 @@ pub enum Error { CaChildExtraResources(Handle, ChildHandle), #[display(fmt = "CA '{}' does not know id certificate for child '{}'", _0, _1)] - CaChildUnauthorised(Handle, ChildHandle), + CaChildUnauthorized(Handle, ChildHandle), #[display( fmt = "You can only update one aspect for child '{}' of CA '{}' at a time - i.e. either resources or ID cert", @@ -190,16 +190,16 @@ pub enum Error { // RouteAuthorizations - ROAs #[display(fmt = "Cannot remove unknown ROA '{}' from CA '{}'", _0, _1)] - CaAuthorisationUnknown(Handle, RouteAuthorization), + CaAuthorizationUnknown(Handle, RouteAuthorization), #[display(fmt = "Duplicate ROA '{}' for CA '{}'", _1, _0)] - CaAuthorisationDuplicate(Handle, RouteAuthorization), + CaAuthorizationDuplicate(Handle, RouteAuthorization), #[display(fmt = "Invalid max length in ROA: '{}' for CA '{}", _1, _0)] - CaAuthorisationInvalidMaxlength(Handle, RouteAuthorization), + CaAuthorizationInvalidMaxlength(Handle, RouteAuthorization), #[display(fmt = "Prefix in ROA '{}' not held by CA '{}'.", _1, _0)] - CaAuthorisationNotEntitled(Handle, RouteAuthorization), + CaAuthorizationNotEntitled(Handle, RouteAuthorization), //----------------------------------------------------------------- // Key Usage Issues @@ -496,8 +496,8 @@ impl Error { .with_ca(ca) .with_child(child) } - Error::CaChildUnauthorised(ca, child) => { - ErrorResponse::new("ca-child-unauthorised", &self) + Error::CaChildUnauthorized(ca, child) => { + ErrorResponse::new("ca-child-unauthorized", &self) .with_ca(ca) .with_child(child) } @@ -509,23 +509,23 @@ impl Error { } // RouteAuthorizations - Error::CaAuthorisationUnknown(ca, auth) => ErrorResponse::new("ca-roa-unknown", &self) + Error::CaAuthorizationUnknown(ca, auth) => ErrorResponse::new("ca-roa-unknown", &self) .with_ca(ca) .with_auth(auth), - Error::CaAuthorisationDuplicate(ca, auth) => { + Error::CaAuthorizationDuplicate(ca, auth) => { ErrorResponse::new("ca-roa-duplicate", &self) .with_ca(ca) .with_auth(auth) } - Error::CaAuthorisationInvalidMaxlength(ca, auth) => { + Error::CaAuthorizationInvalidMaxlength(ca, auth) => { ErrorResponse::new("ca-roa-invalid-max-length", &self) .with_ca(ca) .with_auth(auth) } - Error::CaAuthorisationNotEntitled(ca, auth) => { + Error::CaAuthorizationNotEntitled(ca, auth) => { ErrorResponse::new("ca-roa-not-entitled", &self) .with_ca(ca) .with_auth(auth) @@ -834,32 +834,32 @@ mod tests { ); verify( include_str!( - "../../test-resources/api/regressions/v0_6_0/errors/ca-child-unauthorised.json" + "../../test-resources/api/regressions/v0_6_0/errors/ca-child-unauthorized.json" ), - Error::CaChildUnauthorised(ca.clone(), child), + Error::CaChildUnauthorized(ca.clone(), child), ); verify( include_str!("../../test-resources/api/regressions/v0_6_0/errors/ca-roa-unknown.json"), - Error::CaAuthorisationUnknown(ca.clone(), auth), + Error::CaAuthorizationUnknown(ca.clone(), auth), ); verify( include_str!( "../../test-resources/api/regressions/v0_6_0/errors/ca-roa-duplicate.json" ), - Error::CaAuthorisationDuplicate(ca.clone(), auth), + Error::CaAuthorizationDuplicate(ca.clone(), auth), ); verify( include_str!( "../../test-resources/api/regressions/v0_6_0/errors/ca-roa-invalid-max-length.json" ), - Error::CaAuthorisationInvalidMaxlength(ca.clone(), auth), + Error::CaAuthorizationInvalidMaxlength(ca.clone(), auth), ); verify( include_str!( "../../test-resources/api/regressions/v0_6_0/errors/ca-roa-not-entitled.json" ), - Error::CaAuthorisationNotEntitled(ca, auth), + Error::CaAuthorizationNotEntitled(ca, auth), ); verify( diff --git a/src/daemon/auth.rs b/src/daemon/auth.rs index afb3dd23..8a732905 100644 --- a/src/daemon/auth.rs +++ b/src/daemon/auth.rs @@ -4,7 +4,7 @@ use crate::commons::api::Token; //------------ Authorizer ---------------------------------------------------- -/// This type is responsible for checking authorisations when the API is +/// This type is responsible for checking authorizations when the API is /// accessed. #[derive(Clone, Debug)] pub struct Authorizer { diff --git a/src/daemon/ca/certauth.rs b/src/daemon/ca/certauth.rs index abfb748e..6398dea5 100644 --- a/src/daemon/ca/certauth.rs +++ b/src/daemon/ca/certauth.rs @@ -538,7 +538,7 @@ impl CertAuth { let child_cert = child .id_cert() - .ok_or_else(|| Error::CaChildUnauthorised(self.handle.clone(), child_handle.clone()))?; + .ok_or_else(|| Error::CaChildUnauthorized(self.handle.clone(), child_handle.clone()))?; msg.validate(child_cert) .map_err(|_| Error::Rfc6492SignatureInvalid)?; @@ -687,7 +687,7 @@ impl CertAuth { /// Certifies a child, unless: /// = the child is unknown, - /// = the child is not authorised, + /// = the child is not authorized, /// = the csr is invalid, /// = the limit exceeds the child allocation, /// = the signer throws up.. @@ -1480,7 +1480,7 @@ impl CertAuth { /// impl CertAuth { /// Updates the route authorizations for this CA, and update ROAs. Will return - /// an error in case authorisations are added for which this CA does not hold + /// an error in case authorizations are added for which this CA does not hold /// the prefix. fn route_authorizations_update( &self, @@ -1502,15 +1502,15 @@ impl CertAuth { for auth in added { if !auth.max_length_valid() { - return Err(Error::CaAuthorisationInvalidMaxlength( + return Err(Error::CaAuthorizationInvalidMaxlength( self.handle.clone(), auth, )); } if current_auths.contains(&auth) { - return Err(Error::CaAuthorisationDuplicate(self.handle.clone(), auth)); + return Err(Error::CaAuthorizationDuplicate(self.handle.clone(), auth)); } else if !all_resources.contains(&auth.prefix().into()) { - return Err(Error::CaAuthorisationNotEntitled(self.handle.clone(), auth)); + return Err(Error::CaAuthorizationNotEntitled(self.handle.clone(), auth)); } else { current_auths.insert(auth); res.push(StoredEvent::new( @@ -1532,7 +1532,7 @@ impl CertAuth { )); version += 1; } else { - return Err(Error::CaAuthorisationUnknown(self.handle.clone(), auth)); + return Err(Error::CaAuthorizationUnknown(self.handle.clone(), auth)); } } diff --git a/src/daemon/krillserver.rs b/src/daemon/krillserver.rs index f87b7171..608fea0d 100644 --- a/src/daemon/krillserver.rs +++ b/src/daemon/krillserver.rs @@ -44,7 +44,7 @@ pub struct KrillServer { // The base working directory, used for various storage work_dir: PathBuf, - // Component responsible for API authorisation checks + // Component responsible for API authorization checks authorizer: Authorizer, // Publication server, with configured publishers diff --git a/test-resources/api/regressions/v0_6_0/errors/ca-child-unauthorised.json b/test-resources/api/regressions/v0_6_0/errors/ca-child-unauthorised.json deleted file mode 100644 index ad64d6eb..00000000 --- a/test-resources/api/regressions/v0_6_0/errors/ca-child-unauthorised.json +++ /dev/null @@ -1 +0,0 @@ -{"label":"ca-child-unauthorised","msg":"CA 'ca' does not know id certificate for child 'child'","args":{"ca":"ca","child":"child"}} \ No newline at end of file diff --git a/test-resources/api/regressions/v0_6_0/errors/ca-child-unauthorized.json b/test-resources/api/regressions/v0_6_0/errors/ca-child-unauthorized.json new file mode 100644 index 00000000..509df725 --- /dev/null +++ b/test-resources/api/regressions/v0_6_0/errors/ca-child-unauthorized.json @@ -0,0 +1 @@ +{"label":"ca-child-unauthorized","msg":"CA 'ca' does not know id certificate for child 'child'","args":{"ca":"ca","child":"child"}} \ No newline at end of file