Skip to content

Commit

Permalink
Fix/hashes (#42)
Browse files Browse the repository at this point in the history
* Fix hash; Add context fetch to localdata.

* Resolve packages.

* Add android hash.

* Clear context file when app version changes.
  • Loading branch information
yspreen authored May 15, 2021
1 parent e080c7b commit fee0fca
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
},
{
"package": "JSONSchema",
"repositoryURL": "https://github.com/jnewc/JSONSchema.swift",
"repositoryURL": "https://github.com/eu-digital-green-certificates/JSONSchema.swift",
"state": {
"branch": "master",
"revision": "4637ac1cf57745c29003738f36e1b6c232fbd1a6",
"revision": "4809e8a105b3fd2818a08caf9e3cbcdd7d319af2",
"version": null
}
},
Expand All @@ -42,8 +42,8 @@
"repositoryURL": "https://github.com/kylef/Spectre.git",
"state": {
"branch": null,
"revision": "f79d4ecbf8bc4e1579fbd86c3e1d652fb6876c53",
"version": "0.9.2"
"revision": "d02129a9af77729de049d328dd61e530b6f2bb2b",
"version": null
}
},
{
Expand Down
7 changes: 6 additions & 1 deletion DGCAWallet/Models/LocalData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ struct LocalData: Codable {

var certStrings = [DatedCertString]()
var config = Config.load()
var lastLaunchedAppVersion = Self.appVersion

public func save() {
Self.storage.save(self)
Expand All @@ -58,13 +59,17 @@ struct LocalData: Codable {

static func initialize(completion: @escaping () -> Void) {
storage.loadOverride(fallback: LocalData.sharedInstance) { success in
guard let result = success else {
guard var result = success else {
return
}
let format = l10n("log.certs-loaded")
print(String.localizedStringWithFormat(format, result.certStrings.count))
if result.lastLaunchedAppVersion != Self.appVersion {
result.config = LocalData.sharedInstance.config
}
LocalData.sharedInstance = result
completion()
GatewayConnection.fetchContext()
}
}

Expand Down
10 changes: 8 additions & 2 deletions context.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@
"privacyUrl": "https://publications.europa.eu/en/web/about-us/legal-notices/eu-mobile-apps",
"context": {
"url": "https://dgca-issuance-web.cfapps.eu10.hana.ondemand.com/dgca-issuance-service/context",
"pubKeys": ["Ef6tLK887tpTdkiVkSG7ioXCgNEJsbIgKcAU+dxTTag="]
"pubKeys": [
"lKdU1EbQubxyDDm2q3N8KclZ2C94Num3xXjG0pk+3eI=",
"r/mIkG3eEpVdm+u/ko/cwxzOMo1bk4TyHIlByibiA5E="
]
},
"endpoints": {
"claim": {
"url": "https://dgca-issuance-web.cfapps.eu10.hana.ondemand.com/dgca-issuance-service/dgci/wallet/claim",
"pubKeys": ["Ef6tLK887tpTdkiVkSG7ioXCgNEJsbIgKcAU+dxTTag="]
"pubKeys": [
"lKdU1EbQubxyDDm2q3N8KclZ2C94Num3xXjG0pk+3eI=",
"r/mIkG3eEpVdm+u/ko/cwxzOMo1bk4TyHIlByibiA5E="
]
}
}
},
Expand Down

0 comments on commit fee0fca

Please sign in to comment.