Skip to content

Commit

Permalink
Change raw issuer to digest before passing to x509 (microsoft#6431)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtropets authored Aug 12, 2024
1 parent 1a97e95 commit 4cbc7eb
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 37 deletions.
9 changes: 7 additions & 2 deletions tests/infra/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,17 @@ def generate_cert(
)
subject = x509.Name(
[
x509.NameAttribute(NameOID.COMMON_NAME, cn),
x509.NameAttribute(
NameOID.COMMON_NAME, hashlib.sha256(cn.encode("ascii")).hexdigest()
),
]
)
issuer = x509.Name(
[
x509.NameAttribute(NameOID.COMMON_NAME, issuer_cn),
x509.NameAttribute(
NameOID.COMMON_NAME,
hashlib.sha256(issuer_cn.encode("ascii")).hexdigest(),
),
]
)
builder = (
Expand Down
70 changes: 35 additions & 35 deletions tests/js-custom-authorization/custom_authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -1297,28 +1297,28 @@ def run_interpreter_reuse(args):
if __name__ == "__main__":
cr = ConcurrentRunner()

# cr.add(
# "authz",
# run,
# nodes=infra.e2e_args.nodes(cr.args, 1),
# js_app_bundle=os.path.join(cr.args.js_app_bundle, "js-custom-authorization"),
# )

# cr.add(
# "limits",
# run_limits,
# nodes=infra.e2e_args.nodes(cr.args, 1),
# js_app_bundle=os.path.join(cr.args.js_app_bundle, "js-limits"),
# )

# cr.add(
# "authn",
# run_authn,
# nodes=infra.e2e_args.nodes(cr.args, 1),
# js_app_bundle=os.path.join(cr.args.js_app_bundle, "js-authentication"),
# initial_user_count=4,
# initial_member_count=2,
# )
cr.add(
"authz",
run,
nodes=infra.e2e_args.nodes(cr.args, 1),
js_app_bundle=os.path.join(cr.args.js_app_bundle, "js-custom-authorization"),
)

cr.add(
"limits",
run_limits,
nodes=infra.e2e_args.nodes(cr.args, 1),
js_app_bundle=os.path.join(cr.args.js_app_bundle, "js-limits"),
)

cr.add(
"authn",
run_authn,
nodes=infra.e2e_args.nodes(cr.args, 1),
js_app_bundle=os.path.join(cr.args.js_app_bundle, "js-authentication"),
initial_user_count=4,
initial_member_count=2,
)

cr.add(
"content_types",
Expand All @@ -1327,18 +1327,18 @@ def run_interpreter_reuse(args):
js_app_bundle=os.path.join(cr.args.js_app_bundle, "js-content-types"),
)

# cr.add(
# "api",
# run_api,
# nodes=infra.e2e_args.nodes(cr.args, 1),
# js_app_bundle=os.path.join(cr.args.js_app_bundle, "js-api"),
# )

# cr.add(
# "interpreter_reuse",
# run_interpreter_reuse,
# nodes=infra.e2e_args.min_nodes(cr.args, f=1),
# js_app_bundle=os.path.join(cr.args.js_app_bundle, "js-interpreter-reuse"),
# )
cr.add(
"api",
run_api,
nodes=infra.e2e_args.nodes(cr.args, 1),
js_app_bundle=os.path.join(cr.args.js_app_bundle, "js-api"),
)

cr.add(
"interpreter_reuse",
run_interpreter_reuse,
nodes=infra.e2e_args.min_nodes(cr.args, f=1),
js_app_bundle=os.path.join(cr.args.js_app_bundle, "js-interpreter-reuse"),
)

cr.run()

0 comments on commit 4cbc7eb

Please sign in to comment.