-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IAM: match user-targeted OpenID4VP PDs against session-wallet (#3009)
- Loading branch information
Showing
43 changed files
with
4,121 additions
and
145 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright (C) 2024 Nuts community | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
package iam | ||
|
||
import "encoding/json" | ||
|
||
var _ json.Marshaler = IntrospectAccessToken200JSONResponse{} | ||
|
||
func (r IntrospectAccessToken200JSONResponse) MarshalJSON() ([]byte, error) { | ||
return json.Marshal(TokenIntrospectionResponse(r)) | ||
} |
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,39 @@ | ||
/* | ||
* Copyright (C) 2024 Nuts community | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
package iam | ||
|
||
import ( | ||
"encoding/json" | ||
"github.com/stretchr/testify/assert" | ||
"testing" | ||
) | ||
|
||
func TestIntrospectAccessToken200JSONResponse_MarshalJSON(t *testing.T) { | ||
// deepmap/oapi-codegen generates TokenIntrospectionResponse.MarshalJSON() function to support additionalProperties. | ||
// But, the type being marshalled (due to the Strict Server Interface) is IntrospectAccessToken200JSONResponse | ||
// which is a type definition for the TokenIntrospectionResponse type, which causes the custom MarshalJSON function to be ignored. | ||
// This, in turn, causes additionalProperties not to be marshalled. | ||
// The only way to circumvent this is to have IntrospectAccessToken200JSONResponse implement the json.Marshaler interface, | ||
// and have it call the TokenIntrospectionResponse.MarshalJSON() function. | ||
response := TokenIntrospectionResponse{AdditionalProperties: map[string]interface{}{ | ||
"message": "hello", | ||
}} | ||
asJSON, _ := json.Marshal(IntrospectAccessToken200JSONResponse(response)) | ||
assert.JSONEq(t, `{"active":false, "message":"hello"}`, string(asJSON)) | ||
} |
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
Oops, something went wrong.