Skip to content

Commit

Permalink
Merge branch 'develop' into feature/ocsgw-remove-analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
la3lma authored Nov 18, 2019
2 parents fb9b38e + 17563dc commit 88e46c0
Show file tree
Hide file tree
Showing 91 changed files with 437 additions and 16,637 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- checkout
- run:
name: upgrading Java to open-jdk-12
name: upgrading Java to open-jdk-13
command: |
# sudo apt update; sudo apt install -y wget
sudo wget https://cdn.azul.com/zulu/bin/zulu13.28.11-ca-jdk13.0.1-linux_x64.tar.gz -O /tmp/zulu13.28.11-ca-jdk13.0.1-linux_x64.tar.gz
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
steps:
- checkout
- run:
name: upgrading Java to open-jdk-12
name: upgrading Java to open-jdk-13
command: |
# sudo apt update; sudo apt install -y wget
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins {
jacoco
kotlin("jvm") version "1.3.50" apply false
id("com.google.protobuf") version "0.8.10" apply false
id("com.github.johnrengelman.shadow") version "5.1.0" apply false
id("com.github.johnrengelman.shadow") version "5.2.0" apply false
idea
}

Expand Down
16 changes: 8 additions & 8 deletions buildSrc/src/main/kotlin/org/ostelco/prime/gradle/Version.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ object Version {

const val arrow = "0.8.2"

const val byteBuddy = "1.10.2"
const val byteBuddy = "1.10.3"
const val csv = "1.7"
const val cxf = "3.3.4"
const val dockerComposeJunitRule = "1.3.0"
Expand All @@ -14,16 +14,16 @@ object Version {
const val firebase = "6.11.0"

const val googleCloud = "1.91.3"
const val googleCloudDataStore = "1.99.0"
const val googleCloudDataStore = "1.100.0"
const val googleCloudLogging = "0.116.0-alpha"
const val googleCloudPubSub = "1.99.0"
const val googleCloudStorage = "1.99.0"
const val googleCloudPubSub = "1.100.0"
const val googleCloudStorage = "1.100.0"

const val gson = "2.8.6"
const val grpc = "1.24.1"
const val grpc = "1.25.0"
const val guava = "28.1-jre"
const val jackson = "2.10.0"
const val jacksonDatabind = "2.10.0"
const val jackson = "2.10.1"
const val jacksonDatabind = "2.10.1"
const val javaxActivation = "1.1.1"
const val javaxActivationApi = "1.2.0"
const val javaxAnnotation = "1.3.2"
Expand All @@ -46,7 +46,7 @@ object Version {
const val slf4j = "1.7.29"
// IMPORTANT: When Stripe SDK library version is updated, check if the Stripe API version has changed.
// If so, then update API version in Stripe Web Console for callback Webhooks.
const val stripe = "14.4.1"
const val stripe = "15.3.0"
const val swagger = "2.0.10"
const val swaggerCodegen = "2.4.9"
const val testcontainers = "1.12.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import org.ostelco.prime.model.RegionDetails
import org.ostelco.prime.model.ScanInformation
import org.ostelco.prime.model.SimProfile
import org.ostelco.prime.model.Subscription
import org.ostelco.prime.model.withSimProfileStatusAsInstalled
import org.ostelco.prime.module.getResource
import org.ostelco.prime.paymentprocessor.PaymentProcessor
import org.ostelco.prime.paymentprocessor.core.PlanAlredyPurchasedError
Expand Down Expand Up @@ -118,7 +119,11 @@ class SubscriberDAOImpl : SubscriberDAO {
storage.getAllRegionDetails(identity = identity)
.fold(
{ Context(customer = customer) },
{ regionDetailsCollection -> Context(customer = customer, regions = regionDetailsCollection) })
{ regionDetailsCollection -> Context(
customer = customer,
regions = regionDetailsCollection.map { it.withSimProfileStatusAsInstalled() })
}
)
}
} catch (e: Exception) {
logger.error("Failed to fetch context for customer with identity - $identity", e)
Expand All @@ -131,9 +136,11 @@ class SubscriberDAOImpl : SubscriberDAO {
//
override fun getRegions(identity: Identity): Either<ApiError, Collection<RegionDetails>> {
return try {
storage.getAllRegionDetails(identity).mapLeft {
NotFoundError("Failed to get regions.", ApiErrorCode.FAILED_TO_FETCH_REGIONS, it)
}
storage.getAllRegionDetails(identity)
.bimap(
{ NotFoundError("Failed to get regions.", ApiErrorCode.FAILED_TO_FETCH_REGIONS, it) },
{ regionDetailsList -> regionDetailsList.map { it.withSimProfileStatusAsInstalled() } }
)
} catch (e: Exception) {
logger.error("Failed to get regions for customer with identity - $identity", e)
Either.left(InternalServerError("Failed to get regions", ApiErrorCode.FAILED_TO_FETCH_REGIONS))
Expand All @@ -142,9 +149,11 @@ class SubscriberDAOImpl : SubscriberDAO {

override fun getRegion(identity: Identity, regionCode: String): Either<ApiError, RegionDetails> {
return try {
storage.getRegionDetails(identity, regionCode).mapLeft {
NotFoundError("Failed to get regions.", ApiErrorCode.FAILED_TO_FETCH_REGIONS, it)
}
storage.getRegionDetails(identity, regionCode)
.bimap(
{ NotFoundError("Failed to get regions.", ApiErrorCode.FAILED_TO_FETCH_REGIONS, it) },
{ it.withSimProfileStatusAsInstalled() }
)
} catch (e: Exception) {
logger.error("Failed to get regions for customer with identity - $identity", e)
Either.left(InternalServerError("Failed to get regions", ApiErrorCode.FAILED_TO_FETCH_REGIONS))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ class ProfilesResource {
Response.status(Response.Status.UNAUTHORIZED)
} else {
val trimmedQuery = query.trim()
.replace("'", "")
.replace("\"", "")
if (isMsisdn(trimmedQuery)) {
logger.info("${token.name} Accessing profile for msisdn: $query")
getProfileListForMsisdn(trimmedQuery)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ import kotlin.system.measureTimeMillis
* VERSION: `/v2`
*/
// Using certs from https://github.com/jamesleegovtech/myinfo-demo-app/tree/master/ssl
private val templateTestConfig = String(File("src/test/resources/stg-demoapp-client-privatekey-2018.pem").readBytes())
private val templateTestConfig = File("src/test/resources/stg-demoapp-client-privatekey-2018.pem")
.readText()
.replace("\n","")
.removePrefix("-----BEGIN PRIVATE KEY-----")
.removeSuffix("-----END PRIVATE KEY-----")
Expand Down Expand Up @@ -193,7 +194,8 @@ class RSAKeyTest {
fun `test loading MyInfo Staging client private key`() {

// Using cert from https://github.com/jamesleegovtech/myinfo-demo-app/tree/master/ssl
val base64Encoded = String(File("src/test/resources/stg-demoapp-client-privatekey-2018.pem").readBytes())
val base64Encoded = File("src/test/resources/stg-demoapp-client-privatekey-2018.pem")
.readText()
.replace("\n","")
.removePrefix("-----BEGIN PRIVATE KEY-----")
.removeSuffix("-----END PRIVATE KEY-----")
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon May 27 14:33:41 CEST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-rc-1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import graphql.schema.DataFetcher
import graphql.schema.DataFetchingEnvironment
import org.ostelco.prime.jsonmapper.objectMapper
import org.ostelco.prime.model.Identity
import org.ostelco.prime.model.withSimProfileStatusAsInstalled
import org.ostelco.prime.module.getResource
import org.ostelco.prime.storage.ClientDataSource

Expand Down Expand Up @@ -37,14 +38,14 @@ class ContextDataFetcher : DataFetcher<Map<String, Any>> {
clientDataSource.getAllRegionDetails(identity)
.map { regions ->
map.put("regions", regions.map { region ->
objectMapper.convertValue<Map<String, Any>>(region, object : TypeReference<Map<String, Any>>() {})
objectMapper.convertValue<Map<String, Any>>(region.withSimProfileStatusAsInstalled(), object : TypeReference<Map<String, Any>>() {})
})
}
} else {
clientDataSource.getRegionDetails(identity, regionCode.toLowerCase())
.map { region ->
map.put("regions",
listOf(objectMapper.convertValue<Map<String, Any>>(region, object : TypeReference<Map<String, Any>>() {}))
listOf(objectMapper.convertValue<Map<String, Any>>(region.withSimProfileStatusAsInstalled(), object : TypeReference<Map<String, Any>>() {}))
)
}
}
Expand Down
6 changes: 0 additions & 6 deletions houston/.firebaserc

This file was deleted.

24 changes: 0 additions & 24 deletions houston/.gitignore

This file was deleted.

Loading

0 comments on commit 88e46c0

Please sign in to comment.