Skip to content

Add scripts to create OIDC apps and decompose PEM certs#5

Merged
Stuart B. Wilkins (stuwilkins) merged 6 commits into
NSLS2:mainfrom
stuwilkins:add_scripts
Jun 27, 2026
Merged

Add scripts to create OIDC apps and decompose PEM certs#5
Stuart B. Wilkins (stuwilkins) merged 6 commits into
NSLS2:mainfrom
stuwilkins:add_scripts

Conversation

@stuwilkins

@stuwilkins Stuart B. Wilkins (stuwilkins) commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Add scripts

Description

Adds scripts to:

  • Add OIDC apps to azure, create owner and add correct API permissions
  • Decode PEM chains.
  • Move to using pre-commit as a way to lint

Testing

Tested both through use.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces two standalone utilities to the n2snscripts collection: one for creating/reconciling an Entra ID OIDC app via Microsoft Graph (using the current Azure CLI login), and another for inspecting/verifying PEM certificate chains.

Changes:

  • Add bin/azoidcapp (Python, stdlib-only) to create/reconcile an OIDC app + service principal and grant delegated Graph permissions with admin consent.
  • Add bin/pemdecompose (bash) to list certificates in PEM files and optionally verify chain ordering.
  • Document both scripts and their dependencies in README.md.

Reviewed changes

Copilot reviewed 1 out of 3 changed files in this pull request and generated 1 comment.

File Description
README.md Documents new scripts, usage, dependencies, and exit codes.
bin/pemdecompose New bash utility to list PEM cert blocks and optionally verify chain links.
bin/azoidcapp New Python utility to create/reconcile Entra ID OIDC app/SP and delegated Graph permission grants.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 6 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 20 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/lint.yml
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, and the new scripts worked (within the limits of my Az permissions)

I've recommended updating an outdated GHA.

Comment thread .github/workflows/lint.yml Outdated
Co-authored-by: Padraic Shafer <76011594+padraic-shafer@users.noreply.github.com>
@stuwilkins

Copy link
Copy Markdown
Contributor Author

Padraic Shafer (@padraic-shafer) added suggestion ready to go

@stuwilkins Stuart B. Wilkins (stuwilkins) merged commit c024aac into NSLS2:main Jun 27, 2026
1 check passed
@stuwilkins Stuart B. Wilkins (stuwilkins) deleted the add_scripts branch June 27, 2026 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants