Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"IPFSEnabled" Group Policy Documentation is No Longer Relevant (uplift to 1.75.x) #27231

Merged
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
11 changes: 11 additions & 0 deletions browser/policy/brave_simple_policy_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "brave/components/ai_chat/core/common/pref_names.h"
#include "brave/components/brave_vpn/common/buildflags/buildflags.h"
#include "brave/components/constants/pref_names.h"
#include "brave/components/ipfs/buildflags/buildflags.h"
#include "brave/components/tor/buildflags/buildflags.h"
#include "build/build_config.h"
#include "components/policy/core/browser/configuration_policy_handler.h"
Expand All @@ -28,6 +29,10 @@
#include "brave/components/brave_vpn/common/pref_names.h"
#endif

#if BUILDFLAG(DEPRECATE_IPFS)
#include "brave/components/ipfs/ipfs_prefs.h"
#endif // BUILDFLAG(DEPRECATE_IPFS)

namespace policy {

inline constexpr PolicyToPreferenceMapEntry kBraveSimplePolicyMap[] = {
Expand All @@ -54,6 +59,12 @@ inline constexpr PolicyToPreferenceMapEntry kBraveSimplePolicyMap[] = {
#endif
{policy::key::kBraveAIChatEnabled, ai_chat::prefs::kEnabledByPolicy,
base::Value::Type::BOOLEAN},

#if BUILDFLAG(DEPRECATE_IPFS)
{policy::key::kIPFSEnabled, ipfs::prefs::kIPFSEnabledByPolicy,
base::Value::Type::BOOLEAN},
#endif // BUILDFLAG(DEPRECATE_IPFS)

};

} // namespace policy
Expand Down
7 changes: 2 additions & 5 deletions components/ipfs/ipfs_prefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ inline constexpr char kIPFSInfobarCount[] = "brave.ipfs.infobar_count";
// The number of storage used by IPFS Node
inline constexpr char kIpfsStorageMax[] = "brave.ipfs.storage_max";

// Used to enable/disable IPFS via admin policy.
inline constexpr char kIPFSEnabled[] = "brave.ipfs.enabled";

// Used to determine if local node was ever used.
inline constexpr char kIPFSLocalNodeUsed[] = "brave.ipfs.local_node_used";

Expand Down Expand Up @@ -81,7 +78,7 @@ inline constexpr char kIPFSCompanionEnabled[] = "brave.ipfs_companion_enabled";
namespace ipfs {

void RegisterDeprecatedIpfsPrefs(PrefRegistrySimple* registry) {
registry->RegisterBooleanPref(kIPFSEnabled, true);
registry->RegisterBooleanPref(prefs::kIPFSEnabledByPolicy, true);
registry->RegisterIntegerPref(kIPFSResolveMethod, 0);
registry->RegisterBooleanPref(kIPFSAutoFallbackToGateway, false);
registry->RegisterBooleanPref(kIPFSAlwaysStartMode, false);
Expand All @@ -105,7 +102,7 @@ void RegisterDeprecatedIpfsPrefs(PrefRegistrySimple* registry) {
}

void ClearDeprecatedIpfsPrefs(PrefService* registry) {
registry->ClearPref(kIPFSEnabled);
registry->ClearPref(prefs::kIPFSEnabledByPolicy);
registry->ClearPref(kIPFSResolveMethod);
registry->ClearPref(kIPFSAutoFallbackToGateway);
registry->ClearPref(kIPFSAlwaysStartMode);
Expand Down
7 changes: 7 additions & 0 deletions components/ipfs/ipfs_prefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@

namespace ipfs {

namespace prefs {

// Used to enable/disable IPFS via admin policy. Deprecated
inline constexpr char kIPFSEnabledByPolicy[] = "brave.ipfs.enabled";

} // namespace prefs

void RegisterDeprecatedIpfsPrefs(PrefRegistrySimple* registry);

void ClearDeprecatedIpfsPrefs(PrefService* profile_prefs);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
caption: Enable IPFS feature
default: null
desc: |-
This policy allows an admin to specify whether IPFS feature can be enabled.
example_value: true
features:
can_be_mandatory: true
can_be_recommended: false
dynamic_refresh: false
per_profile: true
owners:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
schema:
type: boolean
supported_on:
- chrome.*:87-
deprecated: true
tags: []
type: main
Loading