-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2442 from constantine2nd/develop
Few tweaks - show User Id on Portal, fix build issue with swagger.
- Loading branch information
Showing
5 changed files
with
61 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJsonUtil.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package code.api.ResourceDocs1_4_0 | ||
|
||
import code.api.util.ConsentJWT | ||
import net.liftweb.json._ | ||
|
||
object SwaggerDefinitionsJsonUtil { | ||
implicit val formats: Formats = DefaultFormats | ||
|
||
// General method to parse JSON into any case class | ||
def parseJsonToCaseClass[T](jsonString: String)(implicit mf: Manifest[T]): Option[T] = { | ||
parse(jsonString).extractOpt[T] | ||
} | ||
|
||
// Usage example with ConsentJWT, or replace ConsentJWT with any other case class | ||
val jwtPayload: Option[ConsentJWT] = parseJsonToCaseClass[ConsentJWT]( | ||
"""{ | ||
"createdByUserId": "", | ||
"sub": "fcf346d2-153b-4430-9a8f-f35768533987", | ||
"iss": "https://127.0.0.1:8080", | ||
"aud": "2664650c-8090-481e-8bd8-03a92f9c87ea", | ||
"jti": "d33f7463-ee49-4e8a-8a92-6138dc183d16", | ||
"iat": 1730373271, | ||
"nbf": 1730373271, | ||
"exp": 1730937600, | ||
"entitlements": [], | ||
"views": [ { | ||
"bank_id": "nlbkb", | ||
"account_id": "95389297-45c4-40eb-9efd-331ba1943da4", | ||
"view_id": "ReadAccountsBerlinGroup" | ||
}], | ||
"access": { | ||
"accounts": [ { | ||
"iban": "RS35260005601001611379" | ||
}] | ||
} | ||
}""" | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters