Rebasing, going about this another way

This commit is contained in:
Ryan Ward
2026-05-06 07:02:12 -05:00
parent d8d4ac9e5d
commit f4e2475c60
36 changed files with 3040 additions and 466 deletions
+2 -2
View File
@@ -511,7 +511,7 @@ impl UserWorkspaces {
)
}
pub fn is_aws_bedrock_credentials_enabled(&self, app: &AppContext) -> bool {
pub fn is_bedrock_enabled(&self, app: &AppContext) -> bool {
// i.e. did the admin go and toggle on aws bedrock in the admin panel?
if !self.is_aws_bedrock_available_from_workspace() {
return false;
@@ -520,7 +520,7 @@ impl UserWorkspaces {
match self.aws_bedrock_host_enablement_setting() {
HostEnablementSetting::Enforce => true,
HostEnablementSetting::RespectUserSetting => *AISettings::as_ref(app)
.aws_bedrock_credentials_enabled
.bedrock_enabled
.value(),
}
}
+5 -5
View File
@@ -254,7 +254,7 @@ fn test_aws_bedrock_credentials_default_off_when_admin_respects_user_setting() {
app.read(|ctx| {
assert!(
!UserWorkspaces::as_ref(ctx).is_aws_bedrock_credentials_enabled(ctx),
!UserWorkspaces::as_ref(ctx).is_bedrock_enabled(ctx),
"respect-user-setting should default the local Bedrock credentials toggle to off"
);
assert!(
@@ -303,13 +303,13 @@ fn test_aws_bedrock_credentials_respect_user_setting() {
AISettings::handle(&app).update(&mut app, |settings, ctx| {
let _ = settings
.aws_bedrock_credentials_enabled
.bedrock_enabled
.set_value(false, ctx);
});
app.read(|ctx| {
assert!(
!UserWorkspaces::as_ref(ctx).is_aws_bedrock_credentials_enabled(ctx),
!UserWorkspaces::as_ref(ctx).is_bedrock_enabled(ctx),
"respect-user-setting should honor the local Bedrock credentials toggle"
);
assert!(
@@ -358,13 +358,13 @@ fn test_aws_bedrock_credentials_enforced_by_admin() {
AISettings::handle(&app).update(&mut app, |settings, ctx| {
let _ = settings
.aws_bedrock_credentials_enabled
.bedrock_enabled
.set_value(false, ctx);
});
app.read(|ctx| {
assert!(
UserWorkspaces::as_ref(ctx).is_aws_bedrock_credentials_enabled(ctx),
UserWorkspaces::as_ref(ctx).is_bedrock_enabled(ctx),
"enforced Bedrock host policy should ignore the local Bedrock credentials toggle"
);
assert!(