Skip to content

Commit 6a2492e

Browse files
committed
Fix a few clippy lints, mostly in doc comments
1 parent 45b6b56 commit 6a2492e

File tree

12 files changed

+20
-18
lines changed

12 files changed

+20
-18
lines changed

clippy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
44
# Please see LICENSE files in the repository root for full details.
55

6-
doc-valid-idents = ["OpenID", "OAuth", "..", "PostgreSQL", "SQLite"]
6+
doc-valid-idents = ["OpenID", "OAuth", "UserInfo", "..", "PostgreSQL", "SQLite"]
77

88
disallowed-methods = [
99
{ path = "rand::thread_rng", reason = "do not create rngs on the fly, pass them as parameters" },

crates/config/src/sections/upstream_oauth2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ pub struct Provider {
652652

653653
/// What to do when receiving an OIDC Backchannel logout request.
654654
///
655-
/// Defaults to "do_nothing".
655+
/// Defaults to `do_nothing`.
656656
#[serde(default, skip_serializing_if = "OnBackchannelLogout::is_default")]
657657
pub on_backchannel_logout: OnBackchannelLogout,
658658
}

crates/handlers/src/graphql/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ async fn test_oauth2_admin(pool: PgPool) {
348348
}
349349

350350
/// Test that we can query the GraphQL endpoint with a token from a
351-
/// client_credentials grant.
351+
/// `client_credentials` grant.
352352
#[sqlx::test(migrator = "mas_storage_pg::MIGRATOR")]
353353
async fn test_oauth2_client_credentials(pool: PgPool) {
354354
setup();

crates/oauth2-types/src/oidc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ pub struct ProviderMetadata {
577577
pub require_request_uri_registration: Option<bool>,
578578

579579
/// Indicates where authorization request needs to be protected as [Request
580-
/// Object] and provided through either request or request_uri parameter.
580+
/// Object] and provided through either request or `request_uri` parameter.
581581
///
582582
/// Defaults to `false`.
583583
///

crates/oauth2-types/src/registration/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,8 @@ pub struct ClientRegistrationResponse {
911911
#[serde_as(as = "Option<TimestampSeconds<i64>>")]
912912
pub client_id_issued_at: Option<DateTime<Utc>>,
913913

914-
/// Time at which the client_secret will expire or 0 if it will not expire.
914+
/// Time at which the `client_secret` will expire or 0 if it will not
915+
/// expire.
915916
///
916917
/// Required if `client_secret` is issued.
917918
#[serde(default)]

crates/policy/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ impl Policy {
397397
Ok(res)
398398
}
399399

400-
/// Evaluate the 'client_registration' entrypoint.
400+
/// Evaluate the `client_registration` entrypoint.
401401
///
402402
/// # Errors
403403
///
@@ -419,7 +419,7 @@ impl Policy {
419419
Ok(res)
420420
}
421421

422-
/// Evaluate the 'authorization_grant' entrypoint.
422+
/// Evaluate the `authorization_grant` entrypoint.
423423
///
424424
/// # Errors
425425
///

crates/storage-pg/src/user/registration.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ mod tests {
524524
&mut rng,
525525
&clock,
526526
"alice".to_owned(),
527-
Some(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1))),
527+
Some(IpAddr::V4(Ipv4Addr::LOCALHOST)),
528528
Some("Mozilla/5.0".to_owned()),
529529
Some(serde_json::json!({"action": "continue_compat_sso_login", "id": "01FSHN9AG0MKGTBNZ16RDR3PVY"})),
530530
)
@@ -534,7 +534,7 @@ mod tests {
534534
assert_eq!(registration.user_agent, Some("Mozilla/5.0".to_owned()));
535535
assert_eq!(
536536
registration.ip_address,
537-
Some(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)))
537+
Some(IpAddr::V4(Ipv4Addr::LOCALHOST))
538538
);
539539
assert_eq!(
540540
registration.post_auth_action,

crates/storage/src/oauth2/authorization_grant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub trait OAuth2AuthorizationGrantRepository: Send + Sync {
3838
/// * `response_mode`: The response mode the client requested
3939
/// * `response_type_id_token`: Whether the `id_token` `response_type` was
4040
/// requested
41-
/// * `login_hint`: The login_hint the client sent, if set
41+
/// * `login_hint`: The `login_hint` the client sent, if set
4242
/// * `locale`: The locale the detected when the user asked for the
4343
/// authorization grant
4444
///

crates/storage/src/oauth2/client.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub trait OAuth2ClientRepository: Send + Sync {
2424
/// The error type returned by the repository
2525
type Error;
2626

27-
/// Lookup an OAuth2 client by its ID
27+
/// Lookup an OAuth client by its ID
2828
///
2929
/// Returns `None` if the client does not exist
3030
///
@@ -37,15 +37,15 @@ pub trait OAuth2ClientRepository: Send + Sync {
3737
/// Returns [`Self::Error`] if the underlying repository fails
3838
async fn lookup(&mut self, id: Ulid) -> Result<Option<Client>, Self::Error>;
3939

40-
/// Find an OAuth2 client by its client ID
40+
/// Find an OAuth client by its client ID
4141
async fn find_by_client_id(&mut self, client_id: &str) -> Result<Option<Client>, Self::Error> {
4242
let Ok(id) = client_id.parse() else {
4343
return Ok(None);
4444
};
4545
self.lookup(id).await
4646
}
4747

48-
/// Find an OAuth2 client by its metadata digest
48+
/// Find an OAuth client by its metadata digest
4949
///
5050
/// Returns `None` if the client does not exist
5151
///
@@ -62,7 +62,7 @@ pub trait OAuth2ClientRepository: Send + Sync {
6262
digest: &str,
6363
) -> Result<Option<Client>, Self::Error>;
6464

65-
/// Load a batch of OAuth2 clients by their IDs
65+
/// Load a batch of OAuth clients by their IDs
6666
///
6767
/// Returns a map of client IDs to clients. If a client does not exist, it
6868
/// is not present in the map.
@@ -79,7 +79,7 @@ pub trait OAuth2ClientRepository: Send + Sync {
7979
ids: BTreeSet<Ulid>,
8080
) -> Result<BTreeMap<Ulid, Client>, Self::Error>;
8181

82-
/// Add a new OAuth2 client
82+
/// Add a new OAuth client
8383
///
8484
/// Returns the client that was added
8585
///

crates/syn2mas/src/synapse_reader/checks.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ pub async fn synapse_config_check_against_mas_config(
250250
///
251251
/// - If there is some database connection error, or the given database is not a
252252
/// Synapse database.
253-
/// - If the OAuth2 section of the MAS configuration could not be parsed.
253+
/// - If the Upstream OAuth section of the MAS configuration could not be
254+
/// parsed.
254255
#[tracing::instrument(skip_all)]
255256
pub async fn synapse_database_check(
256257
synapse_connection: &mut PgConnection,

0 commit comments

Comments
 (0)