Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ version = "0.1.0"
[workspace.lints.rust]
unsafe_code = "forbid"
missing_docs = "warn"
unreachable_pub = "warn"

# Every Clippy warning fails CI: `just rust lint` runs Clippy with `-D warnings`.
# The groups sit at priority -1 so the single lints below can override them.
Expand Down
8 changes: 4 additions & 4 deletions apps/auth-service/src/admin/overview/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl Kinds {
/// How often something happened in the last hour, against an hour's usual
/// count over the last week.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub struct Rate {
pub(crate) struct Rate {
/// In the last hour.
pub last_hour: u64,
/// Per hour, averaged over the week before, rounded up.
Expand All @@ -58,7 +58,7 @@ impl Rate {

/// What needs an administrator's attention.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Problem {
pub(crate) enum Problem {
/// Alerts are open: nobody posted an update on them yet.
OpenAlerts(u64),
/// Far more sign-ins failed in the last hour than usually do.
Expand All @@ -74,7 +74,7 @@ pub enum Problem {

/// What the overview shows.
#[derive(Clone, Debug)]
pub struct Overview {
pub(crate) struct Overview {
/// Rejected passkey and provider authentications.
pub failed_sign_ins: Rate,
/// Browsers signing in.
Expand Down Expand Up @@ -102,7 +102,7 @@ pub struct Overview {
impl Overview {
/// What needs attention, most pressing first.
#[must_use]
pub fn problems(&self) -> Vec<Problem> {
pub(crate) fn problems(&self) -> Vec<Problem> {
let mut problems = Vec::new();
if self.open_alerts > 0 {
problems.push(Problem::OpenAlerts(self.open_alerts));
Expand Down
2 changes: 1 addition & 1 deletion apps/auth-service/src/admin/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const DEFAULT_GRACE_PERIOD: i64 = MINUTES_PER_DAY;

/// A whole number of minutes, written in its largest whole unit, e.g. `365d`.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct Minutes(i64);
pub(crate) struct Minutes(i64);

impl fmt::Display for Minutes {
/// Writes `0`, or the number of days, hours or minutes with its unit.
Expand Down
2 changes: 1 addition & 1 deletion apps/auth-service/src/federation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use url::Url;
mod error;
/// Pending evidence, signup attachment, linking and unlinking.
mod identities;
pub use error::FederationConfigError;
pub(crate) use error::FederationConfigError;
pub(crate) use error::FederationError;
use error::InvalidReturnTo;
pub(crate) use identities::{PendingKind, PendingView};
Expand Down
2 changes: 1 addition & 1 deletion apps/auth-service/src/oidc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub(crate) use authorize::{
AuthorizationDecision, AuthorizationView, RecoveryQuestion, TransactionQuery,
};
use error::Challenge;
pub use error::OidcConfigError;
pub(crate) use error::OidcConfigError;
pub(crate) use error::{OAuthCode, OAuthError, Reject};
pub(crate) use inline::{InlineClaim, InlineResponse};
pub(crate) use logout::{LogoutQuery, LogoutView};
Expand Down
2 changes: 1 addition & 1 deletion apps/auth-service/src/passkey/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ mod settings;
mod types;

pub(crate) use confirmation::AdminProof;
pub use error::PasskeyConfigError;
pub(crate) use error::PasskeyConfigError;
pub(crate) use error::PasskeyError;
pub(crate) use recovery::VerifiedRecoveryUndo;
use types::PasskeyKind;
Expand Down
4 changes: 2 additions & 2 deletions crates/auth-sdk/src/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ macro_rules! scopes {
#[doc = ""]
$(#[$scope_meta])*
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum $scope {}
pub(crate) enum $scope {}

impl $crate::Scope for $scope {
const NAME: &'static str = $name;
Expand All @@ -166,7 +166,7 @@ macro_rules! scopes {

/// Every scope this module declares.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum All {}
pub(crate) enum All {}

impl $crate::__private::Declared for All {
const NAMES: &'static [&'static str] = &[$($name),+];
Expand Down
5 changes: 5 additions & 0 deletions crates/common/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
//! Focused tests for exported vocabulary expansion and identifier syntax.
#![expect(
unreachable_pub,
reason = "The vocabulary macros make their items public, which a test-private enum cannot reach."
)]

use super::*;

str_enum! {
Expand Down
2 changes: 1 addition & 1 deletion crates/ui/src/layout/frames.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use topcoat::{
pub const SOURCE: &str = "https://github.com/sourceorigin-dev/sourceorigin";

/// Where SourceOrigin's users and developers write to.
pub const SUPPORT_ADDRESS: &str = "support@sourceorigin.dev";
pub(crate) const SUPPORT_ADDRESS: &str = "support@sourceorigin.dev";

/// Where every page's footer links SourceOrigin's policies, which sourceorigin.dev serves.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
Expand Down
5 changes: 2 additions & 3 deletions crates/ui/src/layout/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ pub use html::{PreferenceChange, Preferences, Sidebar, Theme, Title, document};
pub use parts::{Pager, page_head};
pub use search::{Destination, Group, Search, SearchPage, search_results};
pub use sections::{AccountNav, Section, account, signed_out};
pub use signed_in::{
Crumb, NavGroup, NavItem, PasskeySignal, Shell, Shortcut, ShortcutKind, Who, shell,
};
pub use signed_in::{Crumb, PasskeySignal, Shortcut, ShortcutKind, Who, shell};

pub(crate) use parts::{
Label, alert_notice, announcement_text, dialog, navigation, page_messages, pager,
private_address,
};
pub(crate) use search::{Searchable, Spot};
pub(crate) use signed_in::{AvatarSize, avatar};
pub(crate) use signed_in::{NavGroup, NavItem, Shell};
6 changes: 3 additions & 3 deletions crates/ui/src/layout/signed_in.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use topcoat::{

/// A link of the sidebar.
#[derive(Clone, Copy, Debug)]
pub struct NavItem<'a> {
pub(crate) struct NavItem<'a> {
/// Its icon.
pub icon: Icon,
/// Its label, also its title once the sidebar is collapsed to icons.
Expand All @@ -36,7 +36,7 @@ pub struct NavItem<'a> {

/// A group of the sidebar's links, under its label, if any.
#[derive(Clone, Copy, Debug)]
pub struct NavGroup<'a> {
pub(crate) struct NavGroup<'a> {
/// Its label, in the sidebar's small type.
pub label: Option<&'a str>,
/// Its links.
Expand Down Expand Up @@ -196,7 +196,7 @@ impl Shortcut<'_> {

/// The frame of a signed-in page: what every part of the shell shows.
#[derive(Clone, Copy, Debug)]
pub struct Shell<'a> {
pub(crate) struct Shell<'a> {
/// Where the brand links.
pub home: &'a str,
/// The part of SourceOrigin the page belongs to, after the brand.
Expand Down
4 changes: 4 additions & 0 deletions crates/ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
//! # Ok(())
//! # }
//! ```
#![expect(
unreachable_pub,
reason = "`#[component]` makes a public props struct beside each public component, which the crate never exports"
)]

/// The admin dashboard, and auth's page handing administrators off to it.
mod admin;
Expand Down
4 changes: 2 additions & 2 deletions tools/xtask/src/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::process::Command;
const LICENSE: &str = "Apache-2.0";

/// A publish of the SDKs at their current versions.
pub struct Publish<'a> {
pub(crate) struct Publish<'a> {
pub workspace: &'a Workspace,
/// Packages and builds everything without uploading, even versions already
/// published, so it checks the packages whatever the registries hold.
Expand All @@ -25,7 +25,7 @@ impl Publish<'_> {
/// with `cargo publish --workspace`, which publishes them in dependency order
/// and builds each from its package, then the npm package with `npm publish`,
/// whose `prepack` script builds it.
pub fn run(&self) -> Result<()> {
pub(crate) fn run(&self) -> Result<()> {
self.check()?;
self.crates()?;
self.npm()
Expand Down
6 changes: 3 additions & 3 deletions tools/xtask/src/release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use anyhow::{Context, Result, bail, ensure};
use std::{fmt::Write as _, fs};

/// A release of the workspace version, from `HEAD`.
pub struct Release<'a> {
pub(crate) struct Release<'a> {
workspace: &'a Workspace,
/// The workspace version, such as `0.2.0`.
version: String,
Expand All @@ -16,7 +16,7 @@ pub struct Release<'a> {
}

impl<'a> Release<'a> {
pub fn new(workspace: &'a Workspace, dry_run: bool) -> Result<Self> {
pub(crate) fn new(workspace: &'a Workspace, dry_run: bool) -> Result<Self> {
Ok(Self {
workspace,
version: workspace.version()?.to_owned(),
Expand All @@ -29,7 +29,7 @@ impl<'a> Release<'a> {
/// release notes, publishes the SDKs, tags `HEAD` `v<version>`, pushes the
/// tag, creates its GitHub release, and closes its minor version's
/// milestone, such as `v0.2`.
pub fn run(&self) -> Result<()> {
pub(crate) fn run(&self) -> Result<()> {
self.check()?;
let previous = self.previous()?;
let previous = previous.as_deref();
Expand Down
Loading