Skip to content

Commit

Permalink
"IPFSEnabled" Group Policy Documentation is No Longer Relevant (uplif…
Browse files Browse the repository at this point in the history
…t to 1.75.x) (#27231)

Uplift of #27086 (squashed) to beta
  • Loading branch information
brave-builds authored Jan 15, 2025
1 parent 418409c commit 4341104
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 5 deletions.
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

0 comments on commit 4341104

Please sign in to comment.