Skip to content
Snippets Groups Projects
Verified Commit 47eadfc2 authored by Jan-Niclas Strüwer's avatar Jan-Niclas Strüwer
Browse files

fixed api usage for auth api

parent bc2a3cd4
No related branches found
No related tags found
No related merge requests found
Pipeline #27127 passed
......@@ -11,6 +11,7 @@ import de.fraunhofer.iem.dataprovider.repository.repository.RepositoryRepository
import de.fraunhofer.iem.dataprovider.utilities.HttpClientWrapper
import io.ktor.client.call.*
import io.ktor.client.request.*
import io.ktor.http.*
import org.springframework.stereotype.Service
import java.util.*
......@@ -79,14 +80,15 @@ class RepositoryService(
}
suspend fun validateUser(validateUserDto: ValidateUserDto) {
val userCookie = httpClient.get(getAuthApiPath(validateUserDto))
val userCookie = httpClient.get(openCodeApiProperties.auth) {
url {
appendPathSegments(validateUserDto.b)
parameters.append("apiKey", openCodeApiProperties.authApiKey)
}
}
println(userCookie)
println(userCookie.headers)
println(userCookie.body<Any>())
}
private fun getAuthApiPath(validateUserDto: ValidateUserDto): String {
return "${openCodeApiProperties.auth}${validateUserDto.b}?apiKey=${openCodeApiProperties.authApiKey}"
}
}
......@@ -8,7 +8,7 @@ opencode.user-name=${OC_GL_USER:}
# Tool APIs
opencode.api.base-path=https://sl.dev.o4oe.de/api/v1/project/
opencode.api.ort=/cve-result
opencode.api.auth=https://sl.dev.o4oe.de/api/receive-session/
opencode.api.auth=https://sl.dev.o4oe.de/api/receive-session
opencode.api.auth-api-key=${AUTH_API_KEY}
# API key to access this server's API
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.