-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: replace authorization custom code with standard ff pipes (#393
) * new adapters which are handling authorization for each api have been added * customcode related step has been removed from contributing file * jwtPipe's has been replaced with the new pipe calling the authorization generator adapter for catalogiApi * jwtPipe's has been replaced with the new pipe calling the authorization generator adapter for zakenApi * jwtPipe's has been replaced with the new pipe calling the authorization generator adapter for documentenApi * custom part in Parameter.java file removed. The whole file will be deleted later. * update forward path names * dummy commit to trigger ci * typo * update xmlSwitchPipe * remove parameter.java --------- Co-authored-by: Meric Akgul <meric@wearefrank.nl> Co-authored-by: MLenterman <marcellenterman@hotmail.com>
- Loading branch information
1 parent
b85182a
commit 1d6671b
Showing
44 changed files
with
587 additions
and
2,882 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
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
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
78 changes: 78 additions & 0 deletions
78
...main/configurations/Translate/Configuration_GenerateAuthorizationHeaderForCatalogiApi.xml
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,78 @@ | ||
<Module xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="../FrankConfig.xsd"> | ||
<Adapter name="GenerateAuthorizationHeaderForCatalogiApi" | ||
active="${GenerateAuthorizationHeaderForCatalogiApi.Active}" | ||
description=""> | ||
|
||
<Receiver name="GenerateAuthorizationHeaderForCatalogiApi"> | ||
<JavaListener name="GenerateAuthorizationHeaderForCatalogiApi" returnedSessionKeys="Error,Authorization" /> | ||
</Receiver> | ||
|
||
<Pipeline> | ||
<Exits> | ||
<Exit name="EXIT" state="SUCCESS" /> | ||
<Exit name="EXCEPTION" state="ERROR" /> | ||
</Exits> | ||
|
||
<XmlSwitchPipe | ||
name="CheckForAuthType" | ||
xpathExpression="$valueAuthType" | ||
> | ||
<Param name="valueAuthType" value="${zaakbrug.zgw.catalogi-api.auth-type}"/> | ||
<Forward name="jwt" path="createJwt"/> | ||
<Forward name="basic" path="GetUserCredentialForBasicAuth"/> | ||
<Forward name="value" path="CreateValueAuthorizationHeader"/> | ||
</XmlSwitchPipe> | ||
|
||
<!-- jwtTokenGeneratorPipe --> | ||
<JwtPipe name="createJwt" | ||
expirationTime="600" | ||
storeResultInSessionKey="myToken" | ||
authAlias="${zaakbrug.zgw.catalogi-api.auth-alias}"> | ||
<Param name="client_id" pattern="{username}" authAlias="${zaakbrug.zgw.catalogi-api.auth-alias}" hidden="true"/> | ||
<Param name="user_id" pattern="{username}" authAlias="${zaakbrug.zgw.catalogi-api.auth-alias}" hidden="true"/> | ||
<Param name="user_representation" pattern="{username}" authAlias="${zaakbrug.zgw.catalogi-api.auth-alias}" hidden="true"/> | ||
<Forward name="success" path="CreateJwtAuthorizationHeader" /> | ||
<Forward name="exception" path="EXCEPTION" /> | ||
</JwtPipe> | ||
|
||
<PutInSessionPipe name="CreateJwtAuthorizationHeader"> | ||
<Param name="Authorization" sessionKey="originalMessage" xpathExpression="concat('Bearer ', $myToken)"> | ||
<Param name="myToken" sessionKey="myToken"/> | ||
</Param> | ||
<Forward name="success" path="EXIT" /> | ||
<Forward name="exception" path="EXCEPTION" /> | ||
</PutInSessionPipe> | ||
|
||
<PutInSessionPipe name="GetUserCredentialForBasicAuth"> | ||
<Param name="user_credential" xpathExpression="concat($username,':',$password)" hidden="true"> | ||
<Param name="username" pattern="{username}" authAlias="${zaakbrug.zgw.catalogi-api.auth-alias}" hidden="true"/> | ||
<Param name="password" pattern="{password}" authAlias="${zaakbrug.zgw.catalogi-api.auth-alias}" hidden="true"/> | ||
</Param> | ||
<Forward name="success" path="CreateBasicAuthToken" /> | ||
</PutInSessionPipe> | ||
|
||
<!-- basicTokenGeneratorPipe --> | ||
<Base64Pipe name="CreateBasicAuthToken" | ||
storeResultInSessionKey="myToken" | ||
getInputFromSessionKey="user_credential"> | ||
<Forward name="success" path="CreateBasicAuthorizationHeader" /> | ||
<Forward name="exception" path="EXCEPTION" /> | ||
</Base64Pipe> | ||
|
||
<PutInSessionPipe name="CreateBasicAuthorizationHeader"> | ||
<Param name="Authorization" sessionKey="originalMessage" xpathExpression="concat('Basic ', $myToken)"> | ||
<Param name="myToken" sessionKey="myToken"/> | ||
</Param> | ||
<Forward name="success" path="EXIT" /> | ||
<Forward name="exception" path="EXCEPTION" /> | ||
</PutInSessionPipe> | ||
|
||
<!-- valueTokenGeneratorPipe --> | ||
<PutInSessionPipe name="CreateValueAuthorizationHeader"> | ||
<Param name="Authorization" pattern="{password}" authAlias="${zaakbrug.zgw.catalogi-api.auth-alias}" hidden="true" /> | ||
<Forward name="success" path="EXIT" /> | ||
</PutInSessionPipe> | ||
</Pipeline> | ||
</Adapter> | ||
</Module> |
Oops, something went wrong.