You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-4Lines changed: 27 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ The Lattice SDK Python library provides convenient access to the Lattice SDK API
18
18
-[Exception Handling](#exception-handling)
19
19
-[Streaming](#streaming)
20
20
-[Pagination](#pagination)
21
+
-[Oauth Token Override](#oauth-token-override)
21
22
-[Advanced](#advanced)
22
23
-[Access Raw Response Data](#access-raw-response-data)
23
24
-[Retries](#retries)
@@ -56,7 +57,8 @@ Instantiate and use the client with the following:
56
57
from anduril import Lattice
57
58
58
59
client = Lattice(
59
-
token="YOUR_TOKEN",
60
+
client_id="YOUR_CLIENT_ID",
61
+
client_secret="YOUR_CLIENT_SECRET",
60
62
)
61
63
client.entities.long_poll_entity_events(
62
64
session_token="sessionToken",
@@ -73,7 +75,8 @@ import asyncio
73
75
from anduril import AsyncLattice
74
76
75
77
client = AsyncLattice(
76
-
token="YOUR_TOKEN",
78
+
client_id="YOUR_CLIENT_ID",
79
+
client_secret="YOUR_CLIENT_SECRET",
77
80
)
78
81
79
82
@@ -109,7 +112,8 @@ The SDK supports streaming responses, as well, the response will be a generator
109
112
from anduril import Lattice
110
113
111
114
client = Lattice(
112
-
token="YOUR_TOKEN",
115
+
client_id="YOUR_CLIENT_ID",
116
+
client_secret="YOUR_CLIENT_SECRET",
113
117
)
114
118
response = client.entities.stream_entities()
115
119
for chunk in response.data:
@@ -124,7 +128,8 @@ Paginated requests will return a `SyncPager` or `AsyncPager`, which can be used
124
128
from anduril import Lattice
125
129
126
130
client = Lattice(
127
-
token="YOUR_TOKEN",
131
+
client_id="YOUR_CLIENT_ID",
132
+
client_secret="YOUR_CLIENT_SECRET",
128
133
)
129
134
response = client.objects.list_objects()
130
135
for item in response:
@@ -143,6 +148,24 @@ for page in pager.iter_pages():
143
148
print(item)
144
149
```
145
150
151
+
## Oauth Token Override
152
+
153
+
This SDK supports two authentication methods: OAuth client credentials flow (automatic token management) or direct bearer token authentication. You can choose between these options when initializing the client:
154
+
155
+
```python
156
+
from anduril import Lattice
157
+
158
+
# Option 1: Direct bearer token (bypass OAuth flow)
0 commit comments