DEV Community

Discussion on: I've made a react component that hides sensitive information in your app.

Collapse
 
_genjudev profile image
Larson • Edited

No. Feature flags are normally used to ignore specific parts of your code in the deployment so they wont get shipped.

SafeView "hides" existing components.

SafeView is a component that allows you to hide sensitive information in your app visually, for presentation purposes, and more.

visually

they still exist when you look in your developer tools.

Collapse
 
itaylisaey profile image
ItayLisaey

Thanks Lars, SafeView purpose is not to secure your sensitive information.

You can look at it more like a showcase/presentaion helper.

Collapse
 
aminmansuri profile image
hidden_dude

Hmm then it's not really secure or "safe".
It's just activating and deactivating.

Thread Thread
 
robbiegm profile image
RobbieGM

What did you think the point of it was?

Thread Thread
 
aminmansuri profile image
hidden_dude

I don't know.. but "safe" doesn't seem like the right word to use here.

Thread Thread
 
christiankozalla profile image
Christian Kozalla

When I read the title of the post, "sensitive information" makes me think of API secrets..

If I want to hide something visually, I can provide a global CSS ID for the same purpose myself...

Thread Thread
 
grantdotdev profile image
Grant Riordan

My thought exactly , I'd rather have a component which perhaps encrypts the data or redacts it on toggle or component render.

Thread Thread
 
aminmansuri profile image
hidden_dude

yeah.. i was thinking something similar.

Thread Thread
 
itaylisaey profile image
ItayLisaey

Sorry about that, didn't mean to mislead anyone.
I think I clearly state in the library that it is only for visual purposes it is NOT secure in anyway by design.

Thread Thread
 
aminmansuri profile image
hidden_dude

Of course not. I just suggest you change the name to "activate" or "hide" rather than "safe". Because "safe" gives the impression of being a security feature.

But good work and kudos for your efforts.

Collapse
 
puritanic profile image
Darkø Tasevski

Feature flags are normally used to ignore specific parts of your code in the deployment so they wont get shipped.

You sure about that @larsonnn ?

From my experience so far, the code behind the feature flags is shipped, but is not available to the user in the production. Talking from the the frontend perspective though, not sure if in native development we can remove code behind the disabled feature flags in compile step.

Thread Thread
 
christiankozalla profile image
Christian Kozalla

We're using feature flags like in a simple if else statement. So the code is shipped and we can switch the flag on and off at runtime.

I'm sure a compile step could remove the code behind the flag, but then you couldn't toggle the flags at runtime

Thanks for sharing your experience :)