File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -14,18 +14,27 @@ from nocodb.infra.requests_client import NocoDBRequestsClient
14
14
15
15
# Usage with API Token
16
16
client = NocoDBRequestsClient(
17
+ # Your nocodb root path
18
+ " http://localhost:8080" ,
17
19
# Your API Token retrieved from NocoDB conf
18
20
APIToken(" YOUR-API-TOKEN" ),
19
- # Your nocodb root path
20
- " http://localhost:8080"
21
21
)
22
22
23
23
# Usage with JWT Token
24
24
client = NocoDBRequestsClient(
25
+ # Your nocodb root path
26
+ " http://localhost:8080" ,
25
27
# Your API Token retrieved from NocoDB conf
26
28
JWTAuthToken(" your.jwt.token" ),
29
+ )
30
+
31
+ # Usage with email and password
32
+ client = NocoDBRequestsClient(
27
33
# Your nocodb root path
28
- " http://localhost:8080"
34
+ " http://localhost:8080" ,
35
+ # Your profile credentials
36
+
37
+ password = " 123qwe123!"
29
38
)
30
39
```
31
40
Original file line number Diff line number Diff line change 4
4
5
5
class NocoDBAPIUris (Enum ):
6
6
V1_DB_DATA_PREFIX = "api/v1/db/data"
7
+ V1_AUTH_USER_PREFIX = "api/v1/auth/user"
7
8
8
9
9
10
class NocoDBAPI :
10
11
def __init__ (self , base_uri : str ):
11
12
self .__base_data_uri = (
12
13
f"{ base_uri } /{ NocoDBAPIUris .V1_DB_DATA_PREFIX .value } "
13
14
)
15
+ self .__base_auth_uri = (
16
+ f"{ base_uri } /{ NocoDBAPIUris .V1_AUTH_USER_PREFIX .value } "
17
+ )
18
+ def get_auth_uri (self ):
19
+ return "/" .join (
20
+ (
21
+ self .__base_auth_uri ,
22
+ "signin"
23
+ )
24
+ )
14
25
15
26
def get_table_uri (self , project : NocoDBProject , table : str ) -> str :
16
27
return "/" .join (
You can’t perform that action at this time.
0 commit comments