mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-06 04:47:42 +00:00
chore: fix typos in rust code comment or error message
This commit is contained in:
@@ -262,7 +262,7 @@ pub struct GetClusterHealthResponse {
|
||||
pub status: String,
|
||||
/// the number of nodes this Garage node has had a TCP connection to since the daemon started
|
||||
pub known_nodes: usize,
|
||||
/// the nubmer of nodes this Garage node currently has an open connection to
|
||||
/// the number of nodes this Garage node currently has an open connection to
|
||||
pub connected_nodes: usize,
|
||||
/// the number of storage nodes currently registered in the cluster layout
|
||||
pub storage_nodes: usize,
|
||||
@@ -387,7 +387,7 @@ pub struct UpdateAdminTokenRequestBody {
|
||||
/// `GetClusterStatus`, etc), or the special value `*` to allow all
|
||||
/// admin endpoints. **WARNING:** Granting a scope of `CreateAdminToken` or
|
||||
/// `UpdateAdminToken` trivially allows for privilege escalation, and is thus
|
||||
/// functionnally equivalent to granting a scope of `*`.
|
||||
/// functionally equivalent to granting a scope of `*`.
|
||||
pub scope: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
@@ -841,7 +841,7 @@ pub struct GetBucketInfoResponse {
|
||||
pub created: DateTime<Utc>,
|
||||
/// List of global aliases for this bucket
|
||||
pub global_aliases: Vec<String>,
|
||||
/// Whether website acces is enabled for this bucket
|
||||
/// Whether website access is enabled for this bucket
|
||||
pub website_access: bool,
|
||||
#[serde(default)]
|
||||
/// Website configuration for this bucket
|
||||
|
||||
@@ -878,9 +878,9 @@ impl Modify for SecurityAddon {
|
||||
info(
|
||||
version = "v2.2.0",
|
||||
title = "Garage administration API",
|
||||
description = "Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks.
|
||||
description = "Administrate your Garage cluster programmatically, including status, layout, keys, buckets, and maintenance tasks.
|
||||
|
||||
*Disclaimer: This API may change in future Garage versions. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is early stage and can contain bugs, so be careful and please report any issues on our issue tracker.*",
|
||||
*Disclaimer: This API may change in future Garage versions. Read the changelog and upgrade your scripts before upgrading. Additionally, this specification is early stage and can contain bugs, so be careful and please report any issues on our issue tracker.*",
|
||||
contact(
|
||||
name = "The Garage team",
|
||||
email = "garagehq@deuxfleurs.fr",
|
||||
|
||||
@@ -150,7 +150,7 @@ impl TryFrom<HelperError> for CommonError {
|
||||
pub fn pass_helper_error(err: HelperError) -> CommonError {
|
||||
match CommonError::try_from(err) {
|
||||
Ok(e) => e,
|
||||
Err(e) => panic!("Helper error `{}` should hot have happenned here", e),
|
||||
Err(e) => panic!("Helper error `{}` should hot have happened here", e),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ pub fn handle_options_api(
|
||||
// the same name, its CORS rules won't be applied
|
||||
// and will be shadowed by the rules of the globally
|
||||
// existing bucket (but this is inevitable because
|
||||
// OPTIONS calls are not auhtenticated).
|
||||
// OPTIONS calls are not authenticated).
|
||||
if let Some(bn) = bucket_name {
|
||||
let helper = garage.bucket_helper();
|
||||
let bucket_opt = helper.resolve_global_bucket_fast(&bn)?;
|
||||
|
||||
@@ -191,7 +191,7 @@ macro_rules! router_match {
|
||||
}};
|
||||
(@@parse_param $query:expr, parse_default($default:expr), $param:ident) => {{
|
||||
// extract and parse optional query parameter
|
||||
// using provided value as default if paramter is missing
|
||||
// using provided value as default if parameter is missing
|
||||
$query.$param.take().map(|x| x
|
||||
.parse()
|
||||
.map_err(|_| Error::bad_request("Failed to parse query parameter")))
|
||||
|
||||
+1
-1
@@ -378,7 +378,7 @@ pub async fn handle_get_without_ctx(
|
||||
pub(crate) fn check_version_not_deleted(version: &Version) -> Result<(), Error> {
|
||||
if version.deleted.get() {
|
||||
// the version was deleted between when the object_table was consulted
|
||||
// and now, this could mean the object was deleted, or overriden.
|
||||
// and now, this could mean the object was deleted, or overridden.
|
||||
// Rather than say the key doesn't exist, return a transient error
|
||||
// to signal the client to try again.
|
||||
return Err(CommonError::InternalError(UtilError::Message(
|
||||
|
||||
@@ -355,7 +355,7 @@ impl Endpoint {
|
||||
if let Some(x_id) = query.x_id.take() {
|
||||
if x_id != res.name() {
|
||||
// I think AWS ignores the x-id parameter.
|
||||
// Let's make this at least be a warnin to help debugging.
|
||||
// Let's make this at least be a warning to help debugging.
|
||||
warn!(
|
||||
"x-id ({}) does not match parsed endpoint ({})",
|
||||
x_id,
|
||||
@@ -949,7 +949,7 @@ mod tests {
|
||||
GET "/?uploads&delimiter=/&prefix=photos/2006/" => ListMultipartUploads
|
||||
GET "/?uploads&delimiter=D&encoding-type=EncodingType&key-marker=KeyMarker&max-uploads=1&prefix=Prefix&upload-id-marker=UploadIdMarker" => ListMultipartUploads
|
||||
GET "/" => ListObjects
|
||||
GET "/?prefix=N&marker=Ned&max-keys=40" => ListObjects
|
||||
GET "/?prefix=N&marker=Need&max-keys=40" => ListObjects
|
||||
GET "/?delimiter=/" => ListObjects
|
||||
GET "/?prefix=photos/2006/&delimiter=/" => ListObjects
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ impl WebsiteConfiguration {
|
||||
}
|
||||
if self.routing_rules.rules.len() > 1000 {
|
||||
// we will do linear scans, best to avoid overly long configuration. The
|
||||
// limit was choosen arbitrarily
|
||||
// limit was chosen arbitrarily
|
||||
return Err(Error::bad_request(
|
||||
"Bad XML: RoutingRules can't have more than 1000 child elements",
|
||||
));
|
||||
@@ -225,7 +225,7 @@ impl WebsiteConfiguration {
|
||||
pub fn into_garage_website_config(self) -> Result<WebsiteConfig, Error> {
|
||||
if self.redirect_all_requests_to.is_some() {
|
||||
Err(Error::NotImplemented(
|
||||
"RedirectAllRequestsTo is not currently implemented in Garage, however its effect can be emulated using a single inconditional RoutingRule.".into(),
|
||||
"RedirectAllRequestsTo is not currently implemented in Garage, however its effect can be emulated using a single unconditional RoutingRule.".into(),
|
||||
))
|
||||
} else {
|
||||
Ok(WebsiteConfig {
|
||||
@@ -251,7 +251,7 @@ impl WebsiteConfiguration {
|
||||
hostname: rule.redirect.hostname.map(|h| h.0),
|
||||
protocol: rule.redirect.protocol.map(|p| p.0),
|
||||
// aws default to 301, which i find punitive in case of
|
||||
// missconfiguration (can be permanently cached on the
|
||||
// misconfiguration (can be permanently cached on the
|
||||
// user agent)
|
||||
http_redirect_code: rule
|
||||
.redirect
|
||||
|
||||
Reference in New Issue
Block a user