Skip to content

Commit 57ea418

Browse files
author
Baton Admin
committed
chore: update connector skills via baton-admin
1 parent 96f9148 commit 57ea418

File tree

1 file changed

+148
-0
lines changed

1 file changed

+148
-0
lines changed
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# concepts-access-model
2+
3+
What connectors sync: resources, entitlements, and grants.
4+
5+
---
6+
7+
## Purpose of Connectors
8+
9+
Connectors answer: **Who has access to what?**
10+
11+
This is for SOC2 compliance and access control, not operational data.
12+
13+
**Sync:** Users with admin roles, permission assignments, group memberships
14+
**Don't sync:** Customer data, sales records, tickets, email contents
15+
16+
---
17+
18+
## Three Core Concepts
19+
20+
### Resources
21+
22+
Things that exist in the target system.
23+
24+
```go
25+
resource, err := rs.NewUserResource(
26+
"Alice Smith", // displayName
27+
userResourceType, // type
28+
"user-123", // objectID (stable!)
29+
[]rs.UserTraitOption{
30+
rs.WithEmail("alice@example.com", true),
31+
rs.WithStatus(v2.UserTrait_Status_STATUS_ENABLED),
32+
},
33+
)
34+
```
35+
36+
### Entitlements
37+
38+
Permissions that can be granted.
39+
40+
```go
41+
entitlement := sdkEntitlement.NewAssignmentEntitlement(
42+
resource, // the resource offering this entitlement
43+
"member", // slug (stable identifier)
44+
sdkEntitlement.WithDisplayName("Member"),
45+
sdkEntitlement.WithGrantableTo(userResourceType),
46+
)
47+
```
48+
49+
### Grants
50+
51+
Assignments of entitlements to principals.
52+
53+
```go
54+
grant := sdkGrant.NewGrant(
55+
resource, // the resource with the entitlement
56+
"member", // entitlement slug
57+
&v2.ResourceId{ // principal receiving the grant
58+
ResourceType: "user",
59+
Resource: "user-456",
60+
},
61+
)
62+
```
63+
64+
---
65+
66+
## Resource Traits
67+
68+
Traits tell the platform how to interpret resources.
69+
70+
| Trait | Use For | Platform Behavior |
71+
|-------|---------|-------------------|
72+
| `TRAIT_USER` | Human users | Identity correlation, access reviews |
73+
| `TRAIT_GROUP` | Collections | Membership expansion |
74+
| `TRAIT_ROLE` | Permissions | Permission aggregation |
75+
| `TRAIT_APP` | Applications, service accounts | App catalog, machine identities |
76+
77+
**Common mistake:** Using TRAIT_USER for service accounts or AWS accounts. These are TRAIT_APP.
78+
79+
---
80+
81+
## Standard Resource Types
82+
83+
Every connector should have:
84+
85+
### Users (TRAIT_USER)
86+
- Human users who receive grants
87+
- Usually no entitlements (they don't grant to others)
88+
- `Entitlements()` returns empty
89+
- `Grants()` returns empty
90+
91+
### Groups (TRAIT_GROUP)
92+
- Collections of users
93+
- Entitlement: "member"
94+
- `Grants()` returns who is a member
95+
96+
### Roles (TRAIT_ROLE)
97+
- Permission definitions
98+
- Entitlement: "assigned"
99+
- `Grants()` returns who has the role
100+
101+
---
102+
103+
## Entitlement Patterns
104+
105+
**Assignment entitlements** - membership in something:
106+
```go
107+
sdkEntitlement.NewAssignmentEntitlement(resource, "member", ...)
108+
```
109+
110+
**Permission entitlements** - capability grants:
111+
```go
112+
sdkEntitlement.NewPermissionEntitlement(resource, "admin", ...)
113+
```
114+
115+
---
116+
117+
## Grant Expansion
118+
119+
When a group has a role, users in the group inherit the role.
120+
121+
```go
122+
// Group "admins" has role "super-user"
123+
// Mark the grant as expandable so C1 expands to group members
124+
grantOptions := []grant.GrantOption{
125+
grant.WithAnnotation(&v2.GrantExpandable{
126+
EntitlementIds: []string{"group:member"},
127+
Shallow: true,
128+
}),
129+
}
130+
131+
grant := sdkGrant.NewGrant(resource, "assigned", groupResourceId, grantOptions...)
132+
```
133+
134+
The SDK handles expanding this to individual users.
135+
136+
---
137+
138+
## What NOT to Sync
139+
140+
| Sync | Don't Sync |
141+
|------|------------|
142+
| Users with licenses | Customer records |
143+
| Admin roles | Sales opportunities |
144+
| Permission assignments | Email contents |
145+
| Group memberships | Project tasks |
146+
| API access levels | Audit logs (unless access-related) |
147+
148+
Focus on: Who can administer? Who has elevated privileges? Who can modify critical configs?

0 commit comments

Comments
 (0)