Skip to content

Commit

Permalink
Update dependency com.cognite:cognite-sdk-scala to v2.9.764 (#843)
Browse files Browse the repository at this point in the history
* Update dependency com.cognite:cognite-sdk-scala to v2.9.764

* more

* more

* fmt

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Dmitry Ivankov <[email protected]>
  • Loading branch information
renovate[bot] and dmivankov authored Oct 16, 2023
1 parent 29e8e59 commit 572819a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 18 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
TEST_OIDC_READ_CLIENT_ID: ${{ secrets.TEST_OIDC_READ_CLIENT_ID }}
TEST_OIDC_READ_CLIENT_SECRET: ${{ secrets.TEST_OIDC_READ_CLIENT_SECRET }}
TEST_OIDC_READ_TENANT: ${{ secrets.TEST_OIDC_READ_TENANT }}
TEST_OIDC_READ_PROJECT: "publicdata"
TEST_CLIENT_ID_BLUEFIELD: ${{ secrets.BLUEFIELD_CLIENT_ID }}
TEST_CLIENT_SECRET_BLUEFIELD: ${{ secrets.BLUEFIELD_CLIENT_SECRET }}
TEST_AAD_TENANT_BLUEFIELD: "b86328db-09aa-4f0e-9a03-0136f604d20a"
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ val sparkVersion = "3.3.3"
val circeVersion = "0.14.6"
val sttpVersion = "3.5.2"
val Specs2Version = "4.20.2"
val cogniteSdkVersion = "2.8.763"
val cogniteSdkVersion = "2.9.764"

val prometheusVersion = "0.16.0"
val log4sVersion = "1.10.0"
Expand Down
9 changes: 1 addition & 8 deletions src/main/scala/cognite/spark/v1/DefaultSource.scala
Original file line number Diff line number Diff line change
Expand Up @@ -346,14 +346,7 @@ object DefaultSource {
}
clientId <- parameters.get("clientId")
clientSecret <- parameters.get("clientSecret")
project <- parameters.get("project")
clientCredentials = OAuth2.ClientCredentials(
tokenUri,
clientId,
clientSecret,
scopes,
project,
audience)
clientCredentials = OAuth2.ClientCredentials(tokenUri, clientId, clientSecret, scopes, audience)
} yield CdfSparkAuth.OAuth2ClientCredentials(clientCredentials)

val session = for {
Expand Down
1 change: 0 additions & 1 deletion src/test/scala/cognite/spark/v1/DefaultSourceTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ class DefaultSourceTest extends WordSpec with Matchers {
"value-ClientId",
"value-ClientSecret",
List("value-Scopes"),
"value-Project",
Some("value-Audience")))
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/cognite/spark/v1/SdkV1RddTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class SdkV1RddTest extends FlatSpec with Matchers with ParallelTestExecution wit
val sdkRdd = {
val relationConfig = getDefaultConfig(
CdfSparkAuth.OAuth2ClientCredentials(readOidcCredentials),
readOidcCredentials.cdfProjectName
readProject
)
SdkV1Rdd[String, String](
spark.sparkContext,
Expand Down
15 changes: 8 additions & 7 deletions src/test/scala/cognite/spark/v1/SparkTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,14 @@ trait SparkTest {
clientSecret = OIDCWrite.clientSecret,
scopes = List(OIDCWrite.scopes),
audience = Some(OIDCWrite.audience),
cdfProjectName = OIDCWrite.project,
)
implicit val sttpBackend: SttpBackend[IO, Any] = CdpConnector.retryingSttpBackend(15, 30)

val writeAuthProvider =
OAuth2.ClientCredentialsProvider[IO](writeCredentials).unsafeRunTimed(1.second).get
val writeClient: GenericClient[IO] = new GenericClient(
applicationName = "jetfire-test",
projectName = writeCredentials.cdfProjectName,
projectName = OIDCWrite.project,
baseUrl = OIDCWrite.baseUrl,
authProvider = writeAuthProvider,
apiVersion = None,
Expand Down Expand Up @@ -100,6 +99,7 @@ trait SparkTest {
// readClientSecret has to be renewed every 180 days at https://hub.cognite.com/open-industrial-data-211
private val readClientSecret = System.getenv("TEST_OIDC_READ_CLIENT_SECRET")
private val readAadTenant = System.getenv("TEST_OIDC_READ_TENANT")
val readProject = System.getenv("TEST_OIDC_READ_PROJECT")

assert(
readClientId != null && !readClientId.isEmpty,
Expand All @@ -110,15 +110,17 @@ trait SparkTest {
assert(
readAadTenant != null && !readAadTenant.isEmpty,
"Environment variable \"TEST_OIDC_READ_TENANT\" was not set")
assert(
readProject != null && !readProject.isEmpty,
"Environment variable \"TEST_OIDC_READ_PROJECT\" was not set")

private val readTokenUri = s"https://login.microsoftonline.com/$readAadTenant/oauth2/v2.0/token"

val readOidcCredentials = OAuth2.ClientCredentials(
tokenUri = uri"$readTokenUri",
clientId = readClientId,
clientSecret = readClientSecret,
scopes = List("https://api.cognitedata.com/.default"),
cdfProjectName = "publicdata"
scopes = List("https://api.cognitedata.com/.default")
)

def dataFrameReaderUsingOidc: DataFrameReader =
Expand All @@ -127,7 +129,7 @@ trait SparkTest {
.option("tokenUri", readTokenUri)
.option("clientId", readClientId)
.option("clientSecret", readClientSecret)
.option("project", "publicdata")
.option("project", readProject)
.option("scopes", "https://api.cognitedata.com/.default")

val testDataSetId = 86163806167772L
Expand Down Expand Up @@ -157,8 +159,7 @@ trait SparkTest {
tokenUri = bluefieldTokenUri,
clientId = bluefieldClientId,
clientSecret = bluefieldClientSecret,
scopes = List("https://bluefield.cognitedata.com/.default"),
cdfProjectName = "extractor-bluefield-testing"
scopes = List("https://bluefield.cognitedata.com/.default")
)

val authProvider =
Expand Down

0 comments on commit 572819a

Please sign in to comment.