Files
probo/pkg/resourcealias/oauth2_scopes.go
Bryan Frimin 9b0a5745a0 Add resourcealias application service
Introduce a standalone resourcealias package with its own service,
IAM policies, and OAuth2 scopes so alias management no longer lives
inside the trust center services. Remove the trust-center-specific
alias services from probo and trust, and wire the new service into
probod, the server, and the API layer.

Signed-off-by: Bryan Frimin <bryan@probo.com>
2026-06-22 11:40:09 +02:00

34 lines
1.2 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 resourcealias
import "go.probo.inc/probo/pkg/coredata"
const (
ScopeV1ResourceAliasRead coredata.OAuth2Scope = "v1:resource-alias:read"
ScopeV1ResourceAlias coredata.OAuth2Scope = "v1:resource-alias"
)
// OAuth2ScopeMappings maps OAuth2 scopes to resource-alias actions.
var OAuth2ScopeMappings = map[coredata.OAuth2Scope][]string{
ScopeV1ResourceAliasRead: {
ActionAliasGet,
},
ScopeV1ResourceAlias: {
ActionAliasSet,
ActionAliasRemove,
},
}