Files
probo/pkg/iam/iam_actions.go
Ludovic Vielle 26c5002932 Add identity-scoped OAuth token management
Let users create, list, and revoke manual bearer tokens from
/me/oauth-tokens, scoped to their identity rather than an
organization. Manual tokens store a null client_id and are
authorized with a self-manage IAM policy.

Wire Connect GraphQL on Identity (list, create, revoke), add
console UI with scoped create flow and credentials dialog, and
cover the flow in e2e tests. Fix list pagination ordering and
keep the Relay connection in sync after create.

Signed-off-by: Ludovic Vielle <ludovic@probo.com>
2026-06-18 20:08:49 +02:00

107 lines
4.4 KiB
Go

// Copyright (c) 2025-2026 Probo Inc <hello@probo.com>.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
// OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
package iam
type Action = string
const (
// Organization actions
ActionOrganizationCreate = "iam:organization:create"
ActionOrganizationGet = "iam:organization:get"
ActionOrganizationUpdate = "iam:organization:update"
ActionOrganizationDelete = "iam:organization:delete"
ActionOrganizationList = "iam:organization:list"
// Identity actions
ActionIdentityGet = "iam:identity:get"
ActionIdentityUpdate = "iam:identity:update"
ActionIdentityDelete = "iam:identity:delete"
// Session actions
ActionSessionList = "iam:session:list"
ActionSessionGet = "iam:session:get"
ActionSessionRevoke = "iam:session:revoke"
ActionSessionRevokeAll = "iam:session:revoke-all"
// Invitation actions
ActionInvitationList = "iam:invitation:list"
ActionInvitationCreate = "iam:invitation:create"
ActionInvitationGet = "iam:invitation:get"
ActionInvitationAccept = "iam:invitation:accept"
ActionInvitationDelete = "iam:invitation:delete"
// Membership actions
ActionMembershipGet = "iam:membership:get"
ActionMembershipList = "iam:membership:list"
ActionMembershipUpdate = "iam:membership:update"
ActionMembershipDelete = "iam:membership:delete"
// Membership role actions
ActionMembershipRoleSetOwner = "iam:membership-role:set-owner"
// Membership Profile actions
ActionMembershipProfileGet = "iam:membership-profile:get"
ActionMembershipProfileList = "iam:membership-profile:list"
ActionMembershipProfileCreate = "iam:membership-profile:create"
ActionMembershipProfileUpdate = "iam:membership-profile:update"
ActionMembershipProfileDelete = "iam:membership-profile:delete"
ActionMembershipProfileActivate = "iam:membership-profile:activate"
ActionMembershipProfileDeactivate = "iam:membership-profile:deactivate"
// Personal API Key actions
ActionPersonalAPIKeyCreate = "iam:personal-api-key:create"
ActionPersonalAPIKeyGet = "iam:personal-api-key:get"
ActionPersonalAPIKeyList = "iam:personal-api-key:list"
ActionPersonalAPIKeyUpdate = "iam:personal-api-key:update"
ActionPersonalAPIKeyDelete = "iam:personal-api-key:delete"
// SAML Configuration actions
ActionSAMLConfigurationCreate = "iam:saml-configuration:create"
ActionSAMLConfigurationGet = "iam:saml-configuration:get"
ActionSAMLConfigurationUpdate = "iam:saml-configuration:update"
ActionSAMLConfigurationDelete = "iam:saml-configuration:delete"
ActionSAMLConfigurationList = "iam:saml-configuration:list"
// SCIM Configuration actions
ActionSCIMConfigurationCreate = "iam:scim-configuration:create"
ActionSCIMConfigurationGet = "iam:scim-configuration:get"
ActionSCIMConfigurationUpdate = "iam:scim-configuration:update"
ActionSCIMConfigurationDelete = "iam:scim-configuration:delete"
// SCIM Event actions
ActionSCIMEventList = "iam:scim-event:list"
ActionSCIMEventGet = "iam:scim-event:get"
// SCIM Bridge actions
ActionSCIMBridgeGet = "iam:scim-bridge:get"
ActionSCIMBridgeCreate = "iam:scim-bridge:create"
ActionSCIMBridgeUpdate = "iam:scim-bridge:update"
ActionSCIMBridgeDelete = "iam:scim-bridge:delete"
// OAuth2 Consent actions
ActionOAuth2ConsentGet = "iam:oauth2-consent:get"
ActionOAuth2ConsentApprove = "iam:oauth2-consent:approve"
// OAuth2 Access Token actions
ActionOAuth2AccessTokenCreate = "iam:oauth2-access-token:create"
ActionOAuth2AccessTokenGet = "iam:oauth2-access-token:get"
ActionOAuth2AccessTokenList = "iam:oauth2-access-token:list"
ActionOAuth2AccessTokenDelete = "iam:oauth2-access-token:delete"
// Audit log entry actions
ActionAuditLogEntryGet = "iam:audit-log-entry:get"
ActionAuditLogEntryList = "iam:audit-log-entry:list"
)