nhi: emit APP_REGISTRATION on Okta apps (K3), excluding BOOKMARK/SWA#171
Open
c1-squire-dev[bot] wants to merge 2 commits into
Open
nhi: emit APP_REGISTRATION on Okta apps (K3), excluding BOOKMARK/SWA#171c1-squire-dev[bot] wants to merge 2 commits into
c1-squire-dev[bot] wants to merge 2 commits into
Conversation
Contributor
Connector PR Review: nhi: emit APP_REGISTRATION on Okta apps (K3), excluding BOOKMARK/SWABlocking Issues: 0 | Suggestions: 0 | Threads Resolved: 0 Review SummaryThis PR adds a Security IssuesNone found. Correctness IssuesNone found. SuggestionsNone. |
8512bd2 to
baa7547
Compare
Emit the NHI Phase-1 K3 resource signal on Okta app AppResources so c1 can classify federated/OIDC apps as non-human identity app-registrations. appResource (pkg/connector/app.go) reads the already-fetched okta.Application.SignOnMode and attaches WithNHIType(NHI_TYPE_APP_REGISTRATION, detail). BOOKMARK and the SWA family (BROWSER_PLUGIN, AUTO_LOGIN, BASIC_AUTH, SECURE_PASSWORD_STORE) are excluded — they are human-facing launchers with no machine credentials. Detail follows RFC §2.8 <platform>.<object>.<purpose>: okta.app.<signon_mode lowercased> (e.g. okta.app.openid_connect), or okta.app when the mode is empty. Interim self-bump baton-sdk v0.10.0 -> v0.11.0 (RFC D-345) for the WithNHIType builder and NonHumanIdentityTrait_NhiType enum. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
…archived (v0.4.5) and can't resolve NonHumanIdentityTrait Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
a91b89a to
7fcb21e
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Emit the NHI Phase-1 K3 resource signal on the Okta app
AppResourceso c1 can classify federated/OIDC Okta apps as non-human identity app-registrations.This is the Class-A K3 mod from NHI RFC §6 (Okta row 5):
app :327 → ➕APP_REGISTRATION (mod; exclude BOOKMARK/SWA). Separate from the K1 credential PR #170 (nhi/emit-credential-type).Change (
pkg/connector/app.go, inappResource)appResourcealready receives the full*okta.Application(fetched bylistApps→client.Application.ListApplications). It now reads the already-presentSignOnModefield and attaches an NHI annotation:No new API calls — pure read of an already-fetched field (a "mod" per §6).
Exclusion logic (BOOKMARK + SWA)
Per §6 this is a mod that excludes BOOKMARK and SWA apps — those are human-facing launchers with no machine credentials, not NHI app-registrations. The discriminator is
signOnMode, whose values are taken authoritatively from theokta-sdk-golang/v2app constructors the connector uses:signOnModeBOOKMARKbookmarkApplication.goBROWSER_PLUGINswaApplication/swaThreeFieldApplication/browserPluginApplicationAUTO_LOGINautoLoginApplication.goBASIC_AUTHbasicAuthApplication.goSECURE_PASSWORD_STOREsecurePasswordStoreApplication.goEverything else (
OPENID_CONNECT,SAML_2_0,WS_FEDERATION, …) is emitted asAPP_REGISTRATION. This is a denylist, matching the RFC's "exclude BOOKMARK/SWA" framing.Detail string (RFC §2.8)
The axis-2 detail follows the
<platform>.<object>.<purpose>convention (dotted lowercase, D-346):okta.app.<signOnMode lowercased>— e.g.okta.app.openid_connect,okta.app.saml_2_0,okta.app.ws_federation— orokta.appwhensignOnModeis empty. The realsignOnModeis the honest discriminator;okta.app.oauth_service(the §2.8 example) is only one of several modes and isn't forced onto SAML/WS-Fed apps.baton-sdk bump (interim self-bump, RFC D-345)
WithNHITypeand theNonHumanIdentityTrait_NhiTypeenum (NHI_TYPE_APP_REGISTRATION = 1) land in baton-sdk v0.11.0, so this PR bumps:Per D-345 this is an interim self-bump; rebases onto the baton-admin fleet bump once it lands. (The RFC's
WithNHISubtypename is stale — the real v0.11.0 helper isWithNHIType(NhiType, detail), verified against the vendored SDK.)Verification
go build ./...— passgo test ./...— pass (pkg/connectorok; addedTestAppResource_NHITypecovering all 9 modes incl. the 5 exclusions)golangci-lint run ./pkg/connector/...— 0 issues🛰️ Built with pqprime.