or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

Files

docs

authentication.mdconfiguration.mdfile-operations.mdindex.mdsource-connector.md

configuration.mddocs/

0

# Configuration

1

2

Comprehensive configuration models for Microsoft OneDrive source connector supporting multiple authentication methods, drive selection, and file filtering options. Built with Pydantic for validation and automatic schema generation.

3

4

## Capabilities

5

6

### Main Configuration Specification

7

8

Primary configuration class that extends Airbyte's file-based specification with OneDrive-specific parameters.

9

10

```python { .api }

11

class SourceMicrosoftOneDriveSpec(AbstractFileBasedSpec, BaseModel):

12

credentials: Union[OAuthCredentials, ServiceCredentials]

13

drive_name: Optional[str]

14

search_scope: str

15

folder_path: str

16

17

class Config:

18

title = "Microsoft OneDrive Source Spec"

19

20

@classmethod

21

def documentation_url(cls) -> str:

22

"""

23

Provides the URL to the documentation for this specific source.

24

25

Returns:

26

str: Documentation URL for OneDrive integration setup

27

"""

28

29

@classmethod

30

def schema(cls, *args: Any, **kwargs: Any) -> Dict[str, Any]:

31

"""

32

Generates the schema mapping for configuration fields.

33

Cleans up legacy settings and processing options.

34

35

Parameters:

36

- args: Variable arguments passed to parent schema method

37

- kwargs: Keyword arguments passed to parent schema method

38

39

Returns:

40

Dict[str, Any]: Complete JSON schema for configuration validation

41

"""

42

```

43

44

### OAuth Authentication Credentials

45

46

OAuth 2.0 credentials model for user-delegated authentication using Microsoft Graph API.

47

48

```python { .api }

49

class OAuthCredentials(BaseModel):

50

auth_type: Literal["Client"]

51

tenant_id: str

52

client_id: str

53

client_secret: str

54

refresh_token: str

55

56

class Config:

57

title = "Authenticate via Microsoft (OAuth)"

58

```

59

60

**Field Descriptions:**

61

- `tenant_id`: Tenant ID of the Microsoft OneDrive user (marked as secret)

62

- `client_id`: Client ID of your Microsoft developer application (marked as secret)

63

- `client_secret`: Client Secret of your Microsoft developer application (marked as secret)

64

- `refresh_token`: Refresh Token of your Microsoft developer application (marked as secret)

65

66

### Service Principal Credentials

67

68

Service key authentication model for application-only access using service principal.

69

70

```python { .api }

71

class ServiceCredentials(BaseModel):

72

auth_type: Literal["Service"]

73

tenant_id: str

74

user_principal_name: str

75

client_id: str

76

client_secret: str

77

78

class Config:

79

title = "Service Key Authentication"

80

```

81

82

**Field Descriptions:**

83

- `tenant_id`: Tenant ID of the Microsoft OneDrive user (marked as secret)

84

- `user_principal_name`: User Principal Name with special character encoding (marked as secret)

85

- `client_id`: Client ID of your Microsoft developer application (marked as secret)

86

- `client_secret`: Client Secret of your Microsoft developer application (marked as secret)

87

88

### Configuration Fields

89

90

**Drive Selection:**

91

```python { .api }

92

drive_name: Optional[str] = Field(

93

title="Drive Name",

94

description="Name of the Microsoft OneDrive drive where the file(s) exist.",

95

default="OneDrive",

96

order=2

97

)

98

```

99

100

**Search Scope:**

101

```python { .api }

102

search_scope: str = Field(

103

title="Search Scope",

104

description="Specifies the location(s) to search for files. Valid options are 'ACCESSIBLE_DRIVES' to search in the selected OneDrive drive, 'SHARED_ITEMS' for shared items the user has access to, and 'ALL' to search both.",

105

default="ALL",

106

enum=["ACCESSIBLE_DRIVES", "SHARED_ITEMS", "ALL"],

107

order=3

108

)

109

```

110

111

**Folder Path:**

112

```python { .api }

113

folder_path: str = Field(

114

title="Folder Path",

115

description="Path to a specific folder within the drives to search for files. Leave empty to search all folders of the drives. This does not apply to shared items.",

116

order=4,

117

default="."

118

)

119

```

120

121

## Usage Examples

122

123

### OAuth Configuration

124

125

```python

126

oauth_config = {

127

"credentials": {

128

"auth_type": "Client",

129

"tenant_id": "12345678-1234-1234-1234-123456789012",

130

"client_id": "87654321-4321-4321-4321-210987654321",

131

"client_secret": "your-client-secret",

132

"refresh_token": "your-refresh-token"

133

},

134

"drive_name": "OneDrive",

135

"search_scope": "ACCESSIBLE_DRIVES",

136

"folder_path": "Documents/Reports",

137

"streams": [{

138

"name": "reports",

139

"globs": ["*.xlsx", "*.csv"],

140

"validation_policy": "Emit Record",

141

"format": {"filetype": "csv"}

142

}]

143

}

144

```

145

146

### Service Principal Configuration

147

148

```python

149

service_config = {

150

"credentials": {

151

"auth_type": "Service",

152

"tenant_id": "12345678-1234-1234-1234-123456789012",

153

"user_principal_name": "datauser@company.onmicrosoft.com",

154

"client_id": "87654321-4321-4321-4321-210987654321",

155

"client_secret": "your-app-secret"

156

},

157

"drive_name": "OneDrive",

158

"search_scope": "ALL",

159

"folder_path": ".",

160

"streams": [{

161

"name": "all_files",

162

"globs": ["**/*"],

163

"validation_policy": "Emit Record",

164

"format": {"filetype": "unstructured"}

165

}]

166

}

167

```

168

169

### Schema Generation

170

171

```python

172

from source_microsoft_onedrive.spec import SourceMicrosoftOneDriveSpec

173

174

# Generate complete configuration schema

175

schema = SourceMicrosoftOneDriveSpec.schema()

176

177

# Access documentation URL

178

doc_url = SourceMicrosoftOneDriveSpec.documentation_url()

179

print(doc_url) # "https://docs.airbyte.com/integrations/sources/one-drive"

180

```

181

182

## Search Scope Options

183

184

- **ACCESSIBLE_DRIVES**: Search only in the specified drive_name (typically "OneDrive")

185

- **SHARED_ITEMS**: Search only in items shared with the authenticated user

186

- **ALL**: Search both accessible drives and shared items (default)

187

188

## File Path Handling

189

190

- **Root Path**: Use "." or "/" to search from the drive root

191

- **Nested Paths**: Specify folder paths like "Documents/Projects" or "Shared Documents"

192

- **Shared Items**: folder_path setting does not apply to shared items scope

193

194

## Authentication Security

195

196

All credential fields are marked with `airbyte_secret=True` for proper secret handling:

197

- Values are masked in logs and UI

198

- Encrypted storage in Airbyte configurations

199

- Secure transmission during connector operations

200

201

## Configuration Validation

202

203

The Pydantic models provide automatic validation:

204

- **Required Fields**: All credential fields are required

205

- **Format Validation**: Ensures proper auth_type discriminator values

206

- **Enum Validation**: search_scope must be one of the allowed values

207

- **Default Values**: Sensible defaults for optional fields