Skip to content

fix(profiles): let the profile form make a credentialed endpoint - #149

Open
Gkrumbach07 wants to merge 1 commit into
ai-openshell:mainfrom
Gkrumbach07:fix/profile-form-credentialed-endpoints
Open

Gkrumbach07 wants to merge 1 commit into
ai-openshell:mainfrom
Gkrumbach07:fix/profile-form-credentialed-endpoints

Conversation

@Gkrumbach07

Copy link
Copy Markdown
Contributor

Fixes #148.

Problem

The Create provider profile form couldn't create a profile with both a credential and a network endpoint. The form sent only host and port. The gateway refuses a credentialed endpoint that is L4 only:

configure L7 inspection or explicitly set allow_uninspected_credentials: true

Change

In CreateProfileModal, each endpoint row now has a protocol:

  • REST or WebSocket comes with an access preset (Read-only / Read-write / Full). On gateway 0.1.6 an inspected protocol is refused without access or rules. New rows default to REST, port 443, Read-write, since an inference API needs POST.
  • Not inspected (L4) comes with the Allow credentials on traffic OpenShell cannot inspect checkbox, worded the same as the policy editor's. The row warns when the profile has credentials and the box isn't ticked.
  • Host check: a host with a scheme, a path, a space or a trailing slash gets an inline error and disables Create. Gateway lint accepts api.example.com/, and a host like that never matches a request.
  • Request body: the form sends networkEndpoints (protojson, the gateway's spelling) instead of the host/port endpoints form. There's no BFF change.

The layout overlap mentioned in #148 didn't reproduce on main at 1400 or 900 px wide, so this PR doesn't touch it.

Testing

  • Live, gateway 0.1.6 (make gateway): gateway lint refuses L4 with no allow, refuses REST with no access, and accepts REST + access, L4 + allow, and a trailing-slash host. Through the UI, I created a REST/Read-write profile and an L4 + allow profile; both were stored as sent, then deleted.
  • Unit tests: 7 new tests in CreateProfileModal.spec.tsx (default and chosen preset, L4 warning and opt-out, no warning without credentials, three bad hosts). The full frontend suite passes (2184), along with eslint, prettier and tsc.

🤖 Generated with Claude Code

The gateway refuses a credentialed profile endpoint that is L4 only unless
it sets allow_uninspected_credentials, and refuses an inspected protocol
without an access preset or rules. The Create provider profile form sent
host and port only, so a profile with a credential and an endpoint could
never be created from it.

Each endpoint row now picks REST, WebSocket or not inspected (L4). An
inspected protocol carries an access preset; L4 offers the
allow-uninspected opt-out and warns when credentials would be refused.
The form sends networkEndpoints in the gateway's spelling.

A host with a scheme, a path, a space or a trailing slash is refused
before it is sent: the gateway's lint accepts `api.example.com/`, and
such a host never matches a request.

Fixes ai-openshell#148

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Gage Krumbach <gkrumbac@redhat.com>

This branch has not been deployed

No deployments
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.

Create provider profile: a profile with credentials and endpoints is always refused (no L7 or allow_uninspected_credentials option)

1 participant