Skip to content

Commit 87824f2

Browse files
refactor(auth)!: rename set_config into set_authentication_config (#2576)
1 parent 763a3ba commit 87824f2

File tree

6 files changed

+12
-7
lines changed

6 files changed

+12
-7
lines changed

src/console/src/auth/store.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
use crate::auth::strategy_impls::AuthHeap;
22
use junobuild_auth::state::types::config::AuthenticationConfig;
33
use junobuild_auth::state::types::interface::SetAuthenticationConfig;
4-
use junobuild_auth::state::{get_config as get_state_config, set_config as set_store_config};
4+
use junobuild_auth::state::{
5+
get_config as get_state_config, set_authentication_config as set_store_config,
6+
};
57

68
pub async fn set_config(
79
proposed_config: &SetAuthenticationConfig,

src/libs/auth/src/state/assert.rs renamed to src/libs/auth/src/state/asserts/authentication.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use junobuild_shared::types::core::DomainName;
66
use junobuild_shared::types::state::Version;
77
use url::Url;
88

9-
pub fn assert_set_config(
9+
pub fn assert_set_authentication_config(
1010
proposed_config: &SetAuthenticationConfig,
1111
current_config: &Option<AuthenticationConfig>,
1212
) -> Result<(), String> {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub mod authentication;

src/libs/auth/src/state/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
mod assert;
1+
mod asserts;
22
pub mod errors;
33
mod heap;
44
mod impls;

src/libs/auth/src/state/store.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::errors::{JUNO_AUTH_ERROR_NOT_CONFIGURED, JUNO_AUTH_ERROR_OPENID_DISABLED};
2-
use crate::state::assert::assert_set_config;
2+
use crate::state::asserts::authentication::assert_set_authentication_config;
33
use crate::state::heap::get_config;
44
use crate::state::heap::insert_config;
55
use crate::state::types::config::{AuthenticationConfig, OpenIdAuthProviders};
@@ -9,13 +9,13 @@ use crate::strategies::AuthHeapStrategy;
99
use junobuild_shared::ic::api::print;
1010
use junobuild_shared::random::raw_rand;
1111

12-
pub fn set_config(
12+
pub fn set_authentication_config(
1313
auth_heap: &impl AuthHeapStrategy,
1414
proposed_config: &SetAuthenticationConfig,
1515
) -> Result<AuthenticationConfig, String> {
1616
let current_config = get_config(auth_heap);
1717

18-
assert_set_config(proposed_config, &current_config)?;
18+
assert_set_authentication_config(proposed_config, &current_config)?;
1919

2020
let config = AuthenticationConfig::prepare(&current_config, proposed_config);
2121

src/libs/satellite/src/auth/store.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ use crate::auth::alternative_origins::update_alternative_origins;
22
use crate::auth::strategy_impls::AuthHeap;
33
use junobuild_auth::state::types::config::AuthenticationConfig;
44
use junobuild_auth::state::types::interface::SetAuthenticationConfig;
5-
use junobuild_auth::state::{get_config as get_state_config, set_config as set_store_config};
5+
use junobuild_auth::state::{
6+
get_config as get_state_config, set_authentication_config as set_store_config,
7+
};
68

79
pub async fn set_config(
810
proposed_config: &SetAuthenticationConfig,

0 commit comments

Comments
 (0)