-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
364 additions
and
84 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,19 @@ | ||
{"iat": 1725967048, "id": "https://refeds.org/category/personalized", "sub": "https://127.0.0.1:4002", "exp": 1728559048} | ||
{"iat": 1726062435, "id": "https://refeds.org/category/personalized", "sub": null, "exp": 1728654435} | ||
{"iat": 1726062483, "id": "https://refeds.org/category/personalized", "sub": null, "exp": 1728654483} | ||
{"iat": 1726062556, "id": "https://refeds.org/category/personalized", "sub": null, "exp": 1728654556} | ||
{"iat": 1726062582, "id": "https://refeds.org/category/personalized", "sub": null, "exp": 1728654582} | ||
{"iat": 1726067529, "id": "https://refeds.org/category/personalized", "sub": null, "exp": 1728659529} | ||
{"iat": 1726067580, "id": "https://refeds.org/category/personalized", "sub": null, "exp": 1728659580} | ||
{"iat": 1726068101, "id": "https://refeds.org/category/personalized", "sub": null, "exp": 1728660101} | ||
{"iat": 1726068332, "id": "https://refeds.org/category/personalized", "sub": null, "exp": 1728660332} | ||
{"iat": 1726068434, "id": "https://refeds.org/category/personalized", "sub": null, "exp": 1728660434} | ||
{"iat": 1726068537, "id": "https://refeds.org/category/personalized", "sub": null, "exp": 1728660537} | ||
{"iat": 1726068598, "id": "https://refeds.org/category/personalized", "sub": null, "exp": 1728660598} | ||
{"iat": 1726074683, "id": "https://refeds.org/category/personalized", "sub": null, "exp": 1728666683} | ||
{"iat": 1726074734, "id": "https://refeds.org/category/personalized", "sub": null, "exp": 1728666734} | ||
{"iat": 1726075226, "id": "https://refeds.org/category/personalized", "sub": null, "exp": 1728667226} | ||
{"iat": 1726075268, "id": "https://refeds.org/category/personalized", "sub": null, "exp": 1728667268} | ||
{"iat": 1726075871, "id": "https://refeds.org/category/personalized", "sub": "https://127.0.0.1:4002", "exp": 1728667871} | ||
{"iat": 1726076382, "id": "https://refeds.org/category/personalized", "sub": "https://127.0.0.1:4002", "exp": 1728668382} | ||
{"iat": 1726076473, "id": "https://refeds.org/category/personalized", "sub": "https://127.0.0.1:4002", "exp": 1728668473} |
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,23 @@ | ||
# Trust Anchor: https://127.0.0.1:7003 | ||
# OpenID Provider: https://127.0.0.1:4004 | ||
# OpenID Relying Party: https://127.0.0.1:4002 | ||
# Trust Mark Issuer: https://127.0.0.1:6000 | ||
|
||
# Get the entity configuration | ||
./get_entity_configuration.py -k -t trust_anchor_local.json -c https://127.0.0.1:4002 | ||
|
||
# Get subordinate statement from superior | ||
./get_subordinate_statement.py -k -t trust_anchor_local.json -s https://127.0.0.1:7003 https://127.0.0.1:4002 | ||
|
||
# Get Trust Chain | ||
./get_trust_chains.py -k -t trust_anchor_local.json https://127.0.0.1:4002 | ||
./get_trust_chains.py -k -t trust_anchor_local.json https://127.0.0.1:4004 | ||
|
||
# Get new trust mark | ||
./get_trust_mark.py -k -t trust_anchor_local.json -i https://refeds.org/category/personalized -s https://127.0.0.1:4002 https://127.0.0.1:6000 | ||
|
||
# Check Trust Mark status | ||
./get_trust_mark_status.py -k -t trust_anchor_local.json -i https://refeds.org/category/personalized | ||
-s https://127.0.0.1:4002 https://127.0.0.1:6000 | ||
|
||
# List subordinates |
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,43 @@ | ||
#!/usr/bin/env python3 | ||
import json | ||
|
||
from pygments import highlight | ||
from pygments.formatters.terminal import TerminalFormatter | ||
from pygments.lexers.data import JsonLexer | ||
|
||
from fedservice.entity.function.trust_chain_collector import unverified_entity_statement | ||
from fedservice.entity.function.trust_chain_collector import verify_self_signed_signature | ||
from fedservice.utils import make_federation_entity | ||
|
||
if __name__ == '__main__': | ||
import argparse | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument('-k', "--insecure", action='store_true') | ||
parser.add_argument('-t', "--trust_anchors_file") | ||
parser.add_argument(dest="entity_id") | ||
args = parser.parse_args() | ||
|
||
if not args.entity_id: | ||
print("Need an entity_id to work with") | ||
|
||
if args.trust_anchors_file: | ||
trust_anchors = json.loads(open(args.trust_anchors_file).read()) | ||
else: | ||
trust_anchors = {} | ||
|
||
federation_entity = make_federation_entity(entity_id="https://localhost", | ||
trust_anchors=trust_anchors) | ||
if args.insecure: | ||
federation_entity.keyjar.httpc_params = {"verify": False} | ||
|
||
_collector = federation_entity.get_function("trust_chain_collector") | ||
|
||
# Read the entity configuration | ||
_jws = _collector.get_entity_configuration(args.entity_id) | ||
# Verify the self signed signature | ||
entity_configuration = verify_self_signed_signature(_jws) | ||
json_str = json.dumps(entity_configuration, indent=2) | ||
print(20 * "=" + " Entity Configuration " + 20 * "=") | ||
print(highlight(json_str, JsonLexer(), TerminalFormatter())) |
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,53 @@ | ||
#!/usr/bin/env python3 | ||
import json | ||
|
||
import requests | ||
|
||
from fedservice.defaults import federation_services | ||
from fedservice.entity.function import get_entity_endpoint | ||
from fedservice.utils import make_federation_entity | ||
|
||
if __name__ == '__main__': | ||
import argparse | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument('-k', "--insecure", action='store_true') | ||
parser.add_argument('-t', "--trust_anchors") | ||
parser.add_argument('-i', "--trust_mark_id") | ||
parser.add_argument('-s', "--subject") | ||
parser.add_argument(dest="entity_id") | ||
args = parser.parse_args() | ||
|
||
if not args.entity_id: | ||
print("Need an entity_id to work with") | ||
|
||
trust_anchors = json.loads(open(args.trust_anchors).read()) | ||
|
||
federation_entity = make_federation_entity(entity_id="https://localhost", | ||
services=federation_services("entity_configuration", "trust_mark", | ||
"entity_statement"), | ||
trust_anchors=trust_anchors) | ||
|
||
if args.insecure: | ||
_param = {"verify": False} | ||
federation_entity.keyjar.httpc_params = _param | ||
federation_entity.httpc_params = _param | ||
federation_entity.client.httpc_params = _param | ||
|
||
httpc = getattr(federation_entity, "httpc", None) | ||
if not httpc: | ||
httpc = requests | ||
|
||
# Need to find the trust mark issuer Trust Mark Endpoint | ||
endpoint = get_entity_endpoint(federation_entity, args.entity_id, "federation_entity", | ||
"federation_trust_mark_endpoint") | ||
|
||
# federation_entity.client.context.issuer = args.entity_id | ||
_response = federation_entity.client.do_request("trust_mark", | ||
request_args={ | ||
"trust_mark_id": args.trust_mark_id, | ||
"sub": args.subject | ||
}, | ||
endpoint=endpoint) | ||
#result = _service.parse_response(response) | ||
print(f"Trust mark claims: {_response}") |
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,53 @@ | ||
#!/usr/bin/env python3 | ||
import json | ||
|
||
import requests | ||
|
||
from fedservice.defaults import federation_services | ||
from fedservice.entity.function import get_entity_endpoint | ||
from fedservice.utils import make_federation_entity | ||
|
||
if __name__ == '__main__': | ||
import argparse | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument('-k', "--insecure", action='store_true') | ||
parser.add_argument('-i', "--trust_mark_id") | ||
parser.add_argument('-s', "--subject") | ||
parser.add_argument('-t', "--trust_anchors") | ||
parser.add_argument(dest="entity_id") | ||
args = parser.parse_args() | ||
|
||
if not args.entity_id: | ||
print("Need an entity_id to work with") | ||
|
||
trust_anchors = json.loads(open(args.trust_anchors).read()) | ||
|
||
federation_entity = make_federation_entity(entity_id="https://localhost", | ||
services=federation_services("entity_configuration", "trust_mark", | ||
"entity_statement", "trust_mark_status"), | ||
trust_anchors=trust_anchors) | ||
|
||
if args.insecure: | ||
_param = {"verify": False} | ||
federation_entity.keyjar.httpc_params = _param | ||
federation_entity.httpc_params = _param | ||
federation_entity.client.httpc_params = _param | ||
|
||
httpc = getattr(federation_entity, "httpc", None) | ||
if not httpc: | ||
httpc = requests | ||
|
||
# Need to find the trust mark issuer Trust Mark Endpoint | ||
endpoint = get_entity_endpoint(federation_entity, args.entity_id, "federation_entity", | ||
"federation_trust_mark_status_endpoint") | ||
|
||
# federation_entity.client.context.issuer = args.entity_id | ||
_response = federation_entity.client.do_request("trust_mark_status", | ||
request_args={ | ||
"trust_mark_id": args.trust_mark_id, | ||
"sub": args.subject | ||
}, | ||
endpoint=endpoint) | ||
#result = _service.parse_response(response) | ||
print(f"Trust mark status: {_response}") |
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,42 @@ | ||
#!/usr/bin/env python3 | ||
import json | ||
|
||
from fedservice.defaults import federation_services | ||
from fedservice.entity.function import get_entity_endpoint | ||
from fedservice.utils import make_federation_entity | ||
|
||
if __name__ == '__main__': | ||
import argparse | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument('-k', "--insecure", action='store_true') | ||
parser.add_argument('-t', "--trust_anchors_file") | ||
parser.add_argument('-s', "--superior") | ||
parser.add_argument(dest="entity_id") | ||
args = parser.parse_args() | ||
|
||
if not args.entity_id: | ||
print("Need an entity_id to work with") | ||
|
||
if args.trust_anchors_file: | ||
trust_anchors = json.loads(open(args.trust_anchors_file).read()) | ||
else: | ||
trust_anchors = {} | ||
|
||
federation_entity = make_federation_entity(entity_id="https://localhost", | ||
services=federation_services("entity_configuration", "list", | ||
"entity_statement"), | ||
trust_anchors=trust_anchors) | ||
if args.insecure: | ||
federation_entity.keyjar.httpc_params = {"verify": False} | ||
federation_entity.client.httpc_params = {"verify": False} | ||
|
||
# Need to find the listing endpoint | ||
endpoint = get_entity_endpoint(federation_entity, args.entity_id, "federation_entity", | ||
"federation_list_endpoint") | ||
|
||
# Ask the superior for the subordinates statement | ||
_response = federation_entity.client.do_request('list', endpoint=endpoint) | ||
|
||
# Don't try to verify the signatures | ||
print(20 * "=" + f" Subordinates: {_response} " + 20 * "=") |
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,21 @@ | ||
{ | ||
"https://127.0.0.1:7003": { | ||
"keys": [ | ||
{ | ||
"kty": "RSA", | ||
"use": "sig", | ||
"kid": "ZXFYbDlqWkNzaWd1eDNseTVfWFBNUWRFX3lrQ2Y3b2owaWVMTjNhcnpBMA", | ||
"e": "AQAB", | ||
"n": "qHE53SwNAYWZfLQufshE5vhJDBzAEgdO762SkGcV59GDx2VZIyoSek3Y8X8_Z6pVGeDovBQCBstwD7X4ZL4ynMsGb_Szphx2dlcvYPHfY4BFJWGoROPzo8VJ-z5CLseHKg_LXL-PxTHziZFBawMJn5vTodRQVJIU_WA5K408WuNgBh_IhkTj37L-fajwExYoPMWu-YMNlUWD8ta_hnHxLE43QZW5shq09LcTj9VcJdWey1i4q_ftHoZsFngML-kA8KBImeiirtCHs6V1eA3LxJ5a_KojK7aPcA9VgvPH1987I4gqHFedtLZkV5dewYt4HGQ4O3YQ8IsX1Nse0ib2Sw" | ||
}, | ||
{ | ||
"kty": "EC", | ||
"use": "sig", | ||
"kid": "Nng1Yy1SMmFoRC1VQ2g4NllXSEU1dEtkY0VkX3pweG5RXzdLMjY1WkJNMA", | ||
"crv": "P-256", | ||
"x": "yLcidWumqjOPjJI1OcSjgTtqmOfNzC0APWKdRIFik3Y", | ||
"y": "8IkDqyQyLHB10Klvz7vJIb6jrlJ_-HDgMGusR_JzckE" | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.