|
| 1 | +--- |
| 2 | +# Connector Configuration Reference |
| 3 | +# =============================== |
| 4 | +# This is a reference configuration demonstrating all available options |
| 5 | +# and their purposes in a connector configuration file. |
| 6 | + |
| 7 | +# The application name that identifies this connector |
| 8 | +app_name: Example Application |
| 9 | + |
| 10 | +# Connection Configuration |
| 11 | +# ---------------------- |
| 12 | +# Specifies how to connect to the data source. Supports various connection methods. |
| 13 | +connect: |
| 14 | + # Database connection string (DSN) with environment variable interpolation |
| 15 | + dsn: "mysql://${DB_USER}:${DB_PASS}@${DB_HOST}:3306/${DB_NAME}?parseTime=true" |
| 16 | +# If your database username or password includes characters that require URL encoding, |
| 17 | +# you can specify them as separate options instead of embedding them directly in the DSN. |
| 18 | +# Environment variables are expanded. |
| 19 | +# For example, you might include: |
| 20 | +# username: my_username |
| 21 | +# password: my_secure_password |
| 22 | +# |
| 23 | +# This allows the connector to handle proper URL encoding during DSN construction. |
| 24 | + |
| 25 | +# Resource Types |
| 26 | +# ------------- |
| 27 | +# Defines the resources that can be synchronized from the data source. |
| 28 | +# Each resource type represents a distinct entity type (e.g., users, groups, roles). |
| 29 | +resource_types: |
| 30 | + |
| 31 | + # Example User Resource |
| 32 | + # ------------------- |
| 33 | + user: |
| 34 | + name: "User" # Display name for this resource type |
| 35 | + description: "Represents a user account in the system" |
| 36 | + |
| 37 | + # List Configuration |
| 38 | + # ---------------- |
| 39 | + # Defines how to retrieve a list of resources |
| 40 | + list: |
| 41 | + # SQL query to fetch resources. Supports multiple query types: |
| 42 | + # - Direct SQL queries |
| 43 | + # - Stored procedure calls |
| 44 | + # - Complex joins and subqueries |
| 45 | + query: | |
| 46 | + SELECT |
| 47 | + id, |
| 48 | + username, |
| 49 | + email, |
| 50 | + created_at, |
| 51 | + status, |
| 52 | + department |
| 53 | + FROM users |
| 54 | + WHERE status = 'active' |
| 55 | + AND id > ?<Cursor> |
| 56 | + ORDER BY id ASC |
| 57 | + LIMIT ?<Limit> |
| 58 | +
|
| 59 | + # Mapping Configuration |
| 60 | + # ------------------- |
| 61 | + # Defines how to transform raw data into standardized resource objects |
| 62 | + map: |
| 63 | + # Required Fields |
| 64 | + # -------------- |
| 65 | + # These fields are required for all resources |
| 66 | + id: ".id" # Maps the 'id' column to the resource ID |
| 67 | + display_name: ".username" # Human-readable name |
| 68 | + description: "string(.department) + ' department user'" # Can use CEL expressions |
| 69 | + |
| 70 | + # Optional Traits |
| 71 | + # -------------- |
| 72 | + # Custom attributes specific to this resource type |
| 73 | + traits: |
| 74 | + user: |
| 75 | + # The trait name defines the schema |
| 76 | + emails: |
| 77 | + # Array fields |
| 78 | + - ".email" # Direct field mapping |
| 79 | + - "lowercase(.email)" # CEL transformation |
| 80 | + status: ".status" # Simple field mapping |
| 81 | + profile: |
| 82 | + department: ".department" |
| 83 | + joined_date: ".created_at" |
| 84 | + # Complex CEL transformation example |
| 85 | + full_name: "titleCase(.first_name) + ' ' + titleCase(.last_name)" |
| 86 | + |
| 87 | + # Pagination Configuration |
| 88 | + # ---------------------- |
| 89 | + # Defines how to handle large result sets |
| 90 | + pagination: |
| 91 | + strategy: "cursor" # Options: "cursor", "offset" |
| 92 | + primary_key: "id" # Column used for pagination tracking |
| 93 | + |
| 94 | + # Static Entitlements |
| 95 | + # ------------------ |
| 96 | + # Pre-defined permissions that can be granted |
| 97 | + static_entitlements: |
| 98 | + - id: "access" # Unique identifier for this entitlement |
| 99 | + display_name: "Basic Access" |
| 100 | + description: "Provides basic access to the application" |
| 101 | + purpose: "access" # Purpose: "access", "assignment", "permission" |
| 102 | + grantable_to: |
| 103 | + # Resource types that can receive this entitlement |
| 104 | + - "user" |
| 105 | + - "service_account" |
| 106 | + # Provisioning Configuration |
| 107 | + # ------------------------ |
| 108 | + # Defines how to implement entitlement changes |
| 109 | + provisioning: |
| 110 | + vars: |
| 111 | + # Variables available in provisioning queries |
| 112 | + user_id: "principal.ID" |
| 113 | + access_level: "'basic'" |
| 114 | + |
| 115 | + # Grant Operations |
| 116 | + # --------------- |
| 117 | + grant: |
| 118 | + # SQL statements to execute when granting |
| 119 | + queries: |
| 120 | + - | |
| 121 | + INSERT INTO user_access (user_id, level) |
| 122 | + VALUES (?<user_id>, ?<access_level>) |
| 123 | +
|
| 124 | + # Revoke Operations |
| 125 | + # ---------------- |
| 126 | + revoke: |
| 127 | + # SQL statements to execute when revoking |
| 128 | + queries: |
| 129 | + - | |
| 130 | + DELETE FROM user_access |
| 131 | + WHERE user_id = ?<user_id> |
| 132 | + # Grants Query Configuration |
| 133 | + # ------------------------ |
| 134 | + # Defines how to discover existing entitlements |
| 135 | + grants: |
| 136 | + - query: | |
| 137 | + SELECT |
| 138 | + user_id, |
| 139 | + access_level, |
| 140 | + granted_at |
| 141 | + FROM user_access |
| 142 | + LIMIT ?<Limit> OFFSET ?<Offset> |
| 143 | +
|
| 144 | + # Grant Mapping |
| 145 | + # ------------ |
| 146 | + # Defines how to interpret grant query results |
| 147 | + map: |
| 148 | + - skip_if: ".access_level != 'basic'" # CEL condition to filter results |
| 149 | + principal_id: ".user_id" |
| 150 | + principal_type: "user" |
| 151 | + entitlement_id: "access" |
| 152 | + # Grants Pagination |
| 153 | + # ---------------- |
| 154 | + pagination: |
| 155 | + strategy: "offset" |
| 156 | + primary_key: "user_id" |
| 157 | +
|
| 158 | +# Additional resource types would follow the same pattern |
| 159 | +# Example: groups, roles, applications, etc. |
0 commit comments