Skip to content

Commit

Permalink
Revert "54 import export revoke and verify credential (#55)"
Browse files Browse the repository at this point in the history
This reverts commit 9c45ec1.
  • Loading branch information
2byrds authored Jun 30, 2022
1 parent ddc8967 commit ef8d4f4
Show file tree
Hide file tree
Showing 21 changed files with 361 additions and 768 deletions.
2 changes: 0 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,6 @@ dependencies {
}
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2")

//implementation("io.iohk.atala:prism-api:v1.3.2")

// SICPA PEER-DID-JVM
implementation("org.didcommx:peerdid:0.2.0")

Expand Down
35 changes: 0 additions & 35 deletions android/app/src/main/java/com/rootswallet/PrismModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactContextBaseJavaModule
import com.facebook.react.bridge.ReactMethod
import com.rootsid.wal.library.*
//import io.iohk.atala.prism.api.*
import kotlinx.serialization.json.Json
import kotlinx.serialization.encodeToString
import kotlinx.serialization.decodeFromString
Expand Down Expand Up @@ -65,25 +64,6 @@ class PrismModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaM
}
}

@ReactMethod
fun importCred(walJson: String, credAlias: String, credJson: String, promise: Promise) {
Log.d("PRISM_TAG","Importing credential for "+credAlias+" from wallet "+walJson);
thread(start = true) {
try {
val importedCredential = ImportedCredential(
credAlias,
Json.decodeFromString<VerifiedCredential>(credJson)
)
var newWal = Json.decodeFromString<Wallet>(walJson);
newWal.importedCredentials.add(importedCredential)
//Log.d("PRISM_TAG","Credential imported",walJson)
promise.resolve(Json.encodeToString(newWal));
} catch (e: Exception) {
promise.reject("Publish Error", e);
}
}
}

@ReactMethod
fun issueCred(walJson: String, didAlias: String, credJson: String, promise: Promise) {
Log.d("PRISM_TAG","Issuing credential for "+didAlias+" from wallet "+walJson);
Expand All @@ -101,21 +81,6 @@ class PrismModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaM
}
}

//TODO deal with build errors regarding iog.api
// @ReactMethod
// fun verifyCred(walJson: String, credAlias: String, promise: Promise) {
// Log.d("PRISM_TAG","Verifying credential for "+credAlias+" from wallet "+walJson);
// thread(start = true) {
// try {
// var cliWal = Json.decodeFromString<Wallet>(walJson);
// var verResult = Json.encodeToString(verifyIssuedCredential(cliWal, credAlias))
// Log.d("PRISM_TAG","Credential "+credAlias+" is " + verResult)
// promise.resolve(verResult);
// } catch (e: Exception) {
// promise.reject("Publish Error", e);
// }
// }
// }
// @ReactMethod
// public void fetch(final String path, final Promise promise) {
// new Thread(new Runnable() {
Expand Down
23 changes: 10 additions & 13 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,34 @@
{
"expo": {
"owner": "rootsid",
"name": "rootswallet",
"slug": "rootswallet",
"description": "Open Source Identity Wallet for grass roots efforts that matter",
"privacy": "unlisted",
"version": "0.0.1-alpha",
"version": "1.0.0",
"orientation": "default",
"platforms": ["android"],
"githubUrl": "https://github.com/roots-id/rootswallet",
"icon": "./src/assets/LogoOnly1024.png",
"icon": "./assets/LogoOnly1024.png",
"splash": {
"image": "./src/assets/WhiteTextExtraGlow.png",
"image": "./assets/WhiteTextExtraGlow.png",
"resizeMode": "contain",
"backgroundColor": "#111111"
},
"updates": {
"enabled": true,
"fallbackToCacheTimeout": 10000
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.rootswallet"
},
"android": {
"adaptiveIcon": {

"foregroundImage": "./src/assets/LogoOnly1024.png",
"foregroundImage": "./assets/LogoOnly1024.png",
"backgroundColor": "#111111"
},
"package": "com.rootswallet"
},
"web": {
"favicon": "./src/assets/LogoOnly1024.png"
"favicon": "./assets/LogoOnly1024.png"
}
}
}
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"dependencies": {
"@babel/preset-env": "^7.1.6",
"@react-native-async-storage/async-storage": "~1.15.0",
"@react-native-async-storage/async-storage": "^1.17.3",
"@react-native-community/masked-view": "0.1.10",
"@react-navigation/bottom-tabs": "^6.3.1",
"@react-navigation/core": "6.2.1",
Expand All @@ -28,21 +28,20 @@
"expo-secure-store": "~11.1.0",
"expo-splash-screen": "~0.14.1",
"expo-status-bar": "~1.2.0",
"expo-updates": "~0.11.7",
"expo-updates": "^0.11.6",
"i18next": "^21.6.4",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-i18next": "^11.15.3",
"react-json-view": "^1.21.3",
"react-native": "0.64.3",
"react-native-gesture-handler": "~2.1.0",
"react-native-gifted-chat": "1.0.0-beta-3",
"react-native-gifted-chat": "^0.16.3",
"react-native-localize": "^2.1.7",
"react-native-paper": "^4.12.1",
"react-native-qrcode-svg": "^6.1.2",
"react-native-randombytes": "^3.6.1",
"react-native-reanimated": "~2.3.1",
"react-native-safe-area-context": "^4.2.5",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "~3.10.1",
"react-native-svg": "^12.3.0",
"react-native-uuid": "^2.0.1",
Expand Down
Binary file removed src/assets/butch.png
Binary file not shown.
Binary file removed src/assets/darrell.png
Binary file not shown.
Binary file removed src/assets/esteban.png
Binary file not shown.
Binary file removed src/assets/iog.png
Binary file not shown.
Binary file removed src/assets/lance.png
Binary file not shown.
Binary file removed src/assets/rodo.png
Binary file not shown.
Binary file removed src/assets/tony.png
Binary file not shown.
37 changes: 10 additions & 27 deletions src/models/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { logger } from '../logging';

const ID_SEPARATOR = "_"

//these types must be unique enough to use in regex without conflict
export const MODEL_TYPE_CHAT = "rootsChatType"
export const MODEL_TYPE_MESSAGE = "rootsMsgType"
export const MODEL_TYPE_CREDENTIAL = "rootsCredentialType"
export const MODEL_TYPE_CRED_REQUEST = "rootsCredRequestType"
export const MODEL_TYPE_REL = "rootsRelType"
export const MODEL_TYPE_USER = "rootsUserType"

export function createChat(chatAlias: string, titlePrefix?: string) {
const chat = {
Expand All @@ -19,41 +17,26 @@ export function createChat(chatAlias: string, titlePrefix?: string) {
return chat;
}

export function createMessage(idText: string,bodyText: string,statusText: string,timeInMillis: number,relId: string,system?: boolean=false,cred?: Object=undefined) {
export function createMessage(idText: string,bodyText: string,statusText: string,timeInMillis: number,userId: string,system?: boolean=false,cred?: Object=undefined) {
const msg = {
id: idText,
body: bodyText,
type: statusText,
createdTime: timeInMillis,
rel: relId,
user: userId,
system: system,
cred: cred,
}
logger("models - created msg model w/keys",Object.keys(msg))
return msg;
}

export function createMessageId(chatAlias: string,relId: string,msgNum: number) {
let msgId = getStorageKey(chatAlias,MODEL_TYPE_MESSAGE)+ID_SEPARATOR+relId+ID_SEPARATOR+String(msgNum);
logger("roots - Generated msg id",msgId);
return msgId;
}

export function createRel(relAlias: string, relName: string, relPicUrl: string) {
const rel = {
id: relAlias,
displayName: relName,
displayPictureUrl: relPicUrl,
export function createUser(userAlias: string, userName: string, userPicUrl: string) {
const user = {
id: userAlias,
displayName: userName,
displayPictureUrl: userPicUrl,
}
logger("models - create rel model w/keys",Object.keys(rel))
return rel;
}

//---------------- Keys -----------------------
export function getStorageKey(alias: string,type: string) {
return alias+ID_SEPARATOR+type
}

export function getStorageKeys(aliases: string[], type: string) {
return aliases.map(alias => getStorageKey(alias,type))
logger("models - create user model w/keys",Object.keys(user))
return user;
}
13 changes: 2 additions & 11 deletions src/navigation/AuthStack.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import CreateWalletScreen from '../screens/CreateWalletScreen';
import ChatListScreen from '../screens/ChatListScreen';
import LoadingScreen from '../screens/LoadingScreen';
import LoginScreen from '../screens/LoginScreen';
import ScanQRCodeScreen from '../screens/ScanQRCodeScreen'
import ShowQRCodeScreen from '../screens/ShowQRCodeScreen'
import StartChatScreen from '../screens/StartChatScreen';

Expand Down Expand Up @@ -186,15 +185,8 @@ export default function AuthStack() {
<Stack.Screen
name="Chat"
component={ChatScreen}
options={ ({ navigation, route }) => ({
headerTitle: (props) => <LogoTitle {...props} title={getChatItem(route.params.chatId).title}/>,
headerRight: () =>
<IconButton
icon="plus"
size={28}
color="#e69138"
onPress={() => navigation.navigate('Scan QR Code')}
/>,
options={({ route }) => ({
headerTitle: (props) => <LogoTitle {...props} title={getChatItem(route.params.chatId).title}/>
})}
/>
</Stack.Group>
Expand Down Expand Up @@ -258,7 +250,6 @@ export default function AuthStack() {
<Stack.Screen name="Help" component={HelpScreen}/>
<Stack.Screen name="Create Secure Chat" component={StartChatScreen} />
<Stack.Screen name="Show QR Code" component={ShowQRCodeScreen} />
<Stack.Screen name="Scan QR Code" component={ScanQRCodeScreen} />
</Stack.Group>
</>
)}
Expand Down
95 changes: 0 additions & 95 deletions src/relationships/index.ts

This file was deleted.

Loading

0 comments on commit ef8d4f4

Please sign in to comment.