Skip to content

Commit

Permalink
fix: refactor helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
jcmelati committed Oct 19, 2024
1 parent 2fa41b4 commit ae0d0f3
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
package com.sphereon.oid.fed.client.helpers

fun getEntityConfigurationEndpoint(iss: String): String {
val sb = StringBuilder()
sb.append(iss.trim('"'))
sb.append("/.well-known/openid-federation")
return sb.toString()
return "${if (iss.endsWith("/")) iss.dropLast(1) else iss}/.well-known/openid-federation"
}

fun getSubordinateStatementEndpoint(fetchEndpoint: String, sub: String): String {
val sb = StringBuilder()
sb.append(fetchEndpoint.trim('"'))
sb.append("?sub=")
sb.append(sub)
return sb.toString()
return "${fetchEndpoint.trim('"')}?sub=$sub"
}

0 comments on commit ae0d0f3

Please sign in to comment.