Skip to content

Commit

Permalink
compile
Browse files Browse the repository at this point in the history
  • Loading branch information
dmivankov committed Oct 31, 2023
1 parent a281008 commit 92bc1e6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/main/scala/cognite/spark/v1/DefaultSource.scala
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,14 @@ object DefaultSource {
}
clientId <- parameters.get("clientId")
clientSecret <- parameters.get("clientSecret")
clientCredentials = OAuth2.ClientCredentials(tokenUri, clientId, clientSecret, scopes, audience)
project <- parameters.get("project")
clientCredentials = OAuth2.ClientCredentials(
tokenUri,
clientId,
clientSecret,
scopes,
project,
audience)
} yield CdfSparkAuth.OAuth2ClientCredentials(clientCredentials)

val session = for {
Expand Down
1 change: 1 addition & 0 deletions src/test/scala/cognite/spark/v1/DefaultSourceTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class DefaultSourceTest extends WordSpec with Matchers {
"value-ClientId",
"value-ClientSecret",
List("value-Scopes"),
"value-Project",
Some("value-Audience")))
)
}
Expand Down
7 changes: 5 additions & 2 deletions src/test/scala/cognite/spark/v1/SparkTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ 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)

Expand Down Expand Up @@ -120,7 +121,8 @@ trait SparkTest {
tokenUri = uri"$readTokenUri",
clientId = readClientId,
clientSecret = readClientSecret,
scopes = List("https://api.cognitedata.com/.default")
scopes = List("https://api.cognitedata.com/.default"),
cdfProjectName = readProject
)

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

val authProvider =
Expand Down

0 comments on commit 92bc1e6

Please sign in to comment.