forked from theopenlane/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuilder.go
More file actions
94 lines (92 loc) · 3.61 KB
/
Copy pathbuilder.go
File metadata and controls
94 lines (92 loc) · 3.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package authentik
import (
"github.com/theopenlane/core/internal/ent/integrationgenerated"
"github.com/theopenlane/core/internal/integrations/providerkit"
"github.com/theopenlane/core/internal/integrations/registry"
"github.com/theopenlane/core/internal/integrations/types"
)
// Builder returns the Authentik definition builder
func Builder() registry.Builder {
return registry.Builder(func() (types.Definition, error) {
return types.Definition{
DefinitionSpec: types.DefinitionSpec{
ID: definitionID.ID(),
Family: "Authentik",
DisplayName: "Authentik",
Description: "Collect Authentik directory users, groups, and memberships for identity posture and access governance.",
Category: "identity",
DocsURL: "https://docs.theopenlane.io/docs/platform/integrations/authentik/overview",
Tags: []string{"directory"},
Active: false,
Visible: false,
},
UserInput: &types.UserInputRegistration{
Schema: providerkit.SchemaFrom[UserInput](),
},
CredentialRegistrations: []types.CredentialRegistration{
{
Ref: authentikCredential.ID(),
Name: "Authentik Credential",
Description: "API token used to access Authentik instance data.",
Schema: authentikCredentialSchema,
},
},
Connections: []types.ConnectionRegistration{
{
CredentialRef: authentikCredential.ID(),
Name: "Authentik API Token",
Description: "Configure Authentik access using an API token from your instance.",
CredentialRefs: []types.CredentialSlotID{authentikCredential.ID()},
ClientRefs: []types.ClientID{authentikClient.ID()},
ValidationOperation: healthCheckOperation.Name(),
Integration: integration.Registration(),
Disconnect: &types.DisconnectRegistration{
CredentialRef: authentikCredential.ID(),
Description: "Removes the stored API token from Openlane. If the token is no longer needed, revoke it in your Authentik admin panel under Directory > Tokens.",
},
},
},
Clients: []types.ClientRegistration{
{
Ref: authentikClient.ID(),
CredentialRefs: []types.CredentialSlotID{authentikCredential.ID()},
Description: "Authentik API client",
Build: Client{}.Build,
},
},
Operations: []types.OperationRegistration{
{
Name: healthCheckOperation.Name(),
Description: "Call Authentik API to verify token and instance connectivity",
Topic: definitionID.OperationTopic(healthCheckOperation.Name()),
ClientRef: authentikClient.ID(),
Policy: types.ExecutionPolicy{Inline: true},
ConfigSchema: healthCheckSchema,
Handle: HealthCheck{}.Handle(),
},
{
Name: directorySyncOperation.Name(),
Description: "Collect Authentik directory users, groups, and memberships as directory accounts",
Topic: definitionID.OperationTopic(directorySyncOperation.Name()),
ClientRef: authentikClient.ID(),
ConfigSchema: directorySyncSchema,
Policy: types.ExecutionPolicy{Reconcile: true},
SkipDefaultLookback: true,
Ingest: []types.IngestContract{
{
Schema: integrationgenerated.IntegrationMappingSchemaDirectoryAccount,
},
{
Schema: integrationgenerated.IntegrationMappingSchemaDirectoryGroup,
},
{
Schema: integrationgenerated.IntegrationMappingSchemaDirectoryMembership,
},
},
IngestHandle: DirectorySync{}.IngestHandle(),
},
},
Mappings: authentikMappings(),
}, nil
})
}