-
Notifications
You must be signed in to change notification settings - Fork 583
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(deps): migrate to more secure library for secret management (#11446
) * feat: replace react-native-config with react-native-keys * build(deps): add patch for react-native-keys * docs: add hacks.md entry for rn-keys * refactor: android to use reactnativekeys * refactor: android * refactor: js related code * refactor: ios related stuff - not working * attempt to fix missing node in pre-action * remove placeholder in echo file * undo config changes interfering with cocoapods * uncomment scheme change * update scripts to download the new file * fix: tests * refactor: oss stops complaining Co-authored-by: brainbicycle <[email protected]> * refactor: gitignore + script update * update setup script to update the new file * switch oss flag to string to fix android build Co-authored-by: George <[email protected]> * add back env plugin to fix mapbox token in gradle file Co-authored-by: George <[email protected]> * remove now unused .env file * attempt to handle nvm as well as asdf in preaction script * update preaction again to fix duplicate node stuff * update docs and minor cleanup Co-authored-by: George <[email protected]> * update doctor script Co-authored-by: George <[email protected]> * build(deps): remove most of the patch and bump react-native-keys Co-authored-by: brainbicycle <[email protected]> * workaround for timeout in ci --------- Co-authored-by: George Kartalis <[email protected]>
- Loading branch information
1 parent
f823191
commit b8177b0
Showing
48 changed files
with
376 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
android/app/src/main/java/net/artsy/app/utils/ReactNativeConfigUtils.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,18 @@ | ||
# Adding a New Key | ||
|
||
Keys are stored in `.env.shared` file, accessed through [`react-native-config`](https://github.com/luggit/react-native-config). You need to rebuild in Xcode for changes to the file to take effect. | ||
Keys accessed within the app are stored in `keys.shared.json` file, accessed through [`react-native-keys`](https://github.com/numandev1/react-native-keys). You need to rebuild in Xcode for changes to the file to take effect. | ||
|
||
.env.shared is for artsy people to be able to work and compile. | ||
keys.shared.json is for artsy people to be able to work and compile. | ||
Is in .gitignore, and is downloaded by developers using the yarn setup:artsy script. | ||
It is also the main file that the app gets all the real env vars, keys etc. | ||
|
||
.env.example is for open source people to be able to work and compile and see what env vars need/use. | ||
It is committed in git, and we try to keep the exact layout copied over from .env.shared, but without any actual keys, we replace them with "-" or similar. | ||
keys.example.json is for open source people to be able to work and compile and see what env vars need/use. | ||
It is committed in git, and we try to keep the exact layout copied over from keys.shared.json, but without any actual keys, we replace them with "-" or similar. | ||
|
||
On the React Native side: | ||
On the React Native side follow these [docs](https://github.com/numandev1/react-native-keys?tab=readme-ov-file#javascript) | ||
|
||
```ts | ||
import Config from "react-native-config" | ||
On the native iOS side follow these [docs](https://github.com/numandev1/react-native-keys?tab=readme-ov-file#ios-1) | ||
|
||
// ... | ||
On the native android side follow these [docs](https://github.com/numandev1/react-native-keys?tab=readme-ov-file#android-) | ||
|
||
Config.KEY_NAME | ||
``` | ||
|
||
On the native iOS side: | ||
|
||
```objc | ||
#import <react-native-config/ReactNativeConfig.h> | ||
|
||
// ... | ||
|
||
[ReactNativeConfig envFor:@"KEY_NAME"] | ||
``` | ||
On the native android side: | ||
```java | ||
BuildConfig.KEY_NAME; | ||
``` | ||
|
||
You'll need to update the keys in [`emission.d.ts`](https://github.com/artsy/eigen/blob/869d35e0d83d4afae2cb62ebeab924f420944b0f/typings/emission.d.ts#L58-L72) and [`setupJest.ts`](https://github.com/artsy/eigen/blob/4654bacbcdc8624fb2799e9f86ad7717c5ab604b/src/setupJest.ts#L319-L331). | ||
You'll need to update the keys in setupJest.ts, look for the mock for react-native-keys. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.