This file contains hidden or 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
| module.exports = { | |
| proxy_port: /* port the proxy listens on */ | |
| 8080, | |
| nasa_host: /* NASA API host */ | |
| 'api.nasa.gov', | |
| nasa_protocol: /* NASA API protocol */ | |
| 'https:', | |
| approov_header: /* Approov header name */ | |
| 'approov', | |
| approov_enforcement: /* set true to enforce token checks */ |
This file contains hidden or 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
| const path = require('path'); | |
| const url = require('url'); | |
| const request = require('request'); | |
| const chalk = require('chalk'); | |
| // load api configuration and secrets | |
| const config = require(`${__dirname}/../config.js`); | |
| if (config.nasa_host == null) { |
This file contains hidden or 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
| module.exports = { | |
| approov_token_secret: /* token secret received from Approov demo download */ | |
| 'APPROOV DEMO TOKEN SECRET BASE64 STRING HERE', | |
| google_client_secret: /* client secret received from Google */ | |
| 'GOOGLE CLIENT SECRET HERE' | |
| }; |
This file contains hidden or 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
| import React from "react"; | |
| import { View, Image, Text, StyleSheet } from "react-native"; | |
| const shapeView = (props) => { | |
| const imgSrc = { | |
| 'logo': require('./assets/approov_largelogo.png'), | |
| 'hello': require('./assets/hello.png'), | |
| 'confused': require('./assets/confused.png'), | |
| 'Rectangle': require('./assets/rectangle.png'), | |
| 'Square': require('./assets/square.png'), |
This file contains hidden or 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
| package com.rndemo; | |
| import ... | |
| import com.criticalblue.approov.ApproovPackage; | |
| public class MainApplication extends Application implements ReactApplication { | |
| private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { | |
| @Override |
This file contains hidden or 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
| package com.criticalblue.approov; | |
| import ... | |
| import com.criticalblue.attestationlibrary.ApproovAttestation; | |
| import com.criticalblue.attestationlibrary.ApproovConfig; | |
| import com.criticalblue.attestationlibrary.TokenInterface; | |
| class ApproovModule extends ReactContextBaseJavaModule { |
This file contains hidden or 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
| import React from 'react'; | |
| import { View, Image, Text, Button, StyleSheet } from 'react-native'; | |
| import ShapeView from './ShapeView' | |
| export default class App extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = {shape: 'logo', | |
| status: ''}; | |
| } |
This file contains hidden or 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
| import {NativeModules} from 'react-native'; | |
| NativeModules.Approov.fetchApproovToken(input) | |
| .then(token => { | |
| // do something useful... | |
| }) | |
| .catch((error) => { | |
| throw error; | |
| }); |
This file contains hidden or 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
| import Approov from './Approov'; | |
| class App extends React.Component { | |
| // unchanged code ommitted for brevity... | |
| // get shape | |
| getShape = () => { | |
| Approov.fetch('https://demo-server.approovr.io/shapes', { |
This file contains hidden or 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
| import {NativeModules} from 'react-native'; | |
| const fetchWithToken = (input, options) => { | |
| return NativeModules.Approov.fetchApproovToken(input) | |
| .then(token => { | |
| let optionsA = (options? {...options, headers:{ ...options.headers}}:{headers: {}}); | |
| optionsA.headers['Approov-Token'] = token; | |
| return fetch(input, optionsA) | |
| .then((response) => { |
OlderNewer