-
Notifications
You must be signed in to change notification settings - Fork 21
Update repos for async-auth #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Update repos for async-auth #7
Conversation
3b15c71
to
894201e
Compare
asynchronous-authorization/langchain-next-js/src/utils/session.ts
Outdated
Show resolved
Hide resolved
894201e
to
3a4a893
Compare
I was able to validate the I think we should possibly rebase it here after. A couple more things:
|
asynchronous-authorization/vercel-ai-next-js/src/lib/tools/shop-online.ts
Outdated
Show resolved
Hide resolved
e78eac3
to
6bf1707
Compare
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
./package-lock.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this file added to .gitignore (but the package-lock.json
file is still under version control)?
asynchronous-authorization/vercel-ai-next-js/src/utils/session.ts
Outdated
Show resolved
Hide resolved
7fd8e99
to
150ef82
Compare
bbe2d29
to
b365c2f
Compare
tested a few changes today locally for the asychronous-authorization/langchain-next-js example, and pushed a sample commit after here: quick summary of changes made:
screenshots: (working after using CIBA + Email approval) (failure if user is not enrolled in Guardian, and requestedExpiry is not >= 301) |
f76341f
to
596879f
Compare
asynchronous-authorization/vercel-ai-next-js/src/lib/tools/shop-online.ts
Outdated
Show resolved
Hide resolved
should be rdy to go after... |
596879f
to
1c768df
Compare
091f0e1
to
9703b70
Compare
# FGA_CLIENT_SECRET=<your-fga-store-client-secret> | ||
# FGA_API_URL=https://api.xxx.fga.dev | ||
# FGA_API_AUDIENCE=https://api.xxx.fga.dev/ | ||
# FGA_API_TOKEN_ISSUER=auth.fga.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
// write the relationship tuples to FGA | ||
await addRelation(user.email, document.id); | ||
await addRelation(user.sub, document.id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all user.sub
references can be reverted in this file (please just inspect diff here when applying)
retriever: vectorStore.asRetriever(), | ||
buildQuery: (doc) => ({ | ||
user: `user:${user?.email}`, | ||
user: `user:${user?.sub}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user.email
user: `user:${user?.sub}`, | ||
object: `doc:${doc.metadata.documentId}`, | ||
relation: 'can_view', | ||
relation: 'owner', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can remain can_view
it seems
9703b70
to
e601d4a
Compare
@priley86 Thanks for your comments, especially at this late hour. |
e601d4a
to
e6507bf
Compare
update package.json for ver5
feat: update passthrough quickstart examples feat: update passthrough quickstart examples auth0-samples#2
update package.json for ver5
60639bd
to
7a75e1d
Compare
}) | ||
.from(documentsTable) | ||
.where(or(eq(documentsTable.userId, user.sub), arrayContains(documentsTable.sharedWith, [user.email]))) | ||
.where(or(eq(documentsTable.userId, user.sub), arrayContains(documentsTable.sharedWith, [user.sub]))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.where(or(eq(documentsTable.userId, user.sub), arrayContains(documentsTable.sharedWith, [user.email])))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@priley86 I think that was last thing to change
7a75e1d
to
a492190
Compare
# Database configuration | ||
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/ai_documents_db" | ||
|
||
# Auth0 FGA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not having this should not cause startup failures, atleast has never caused any startup failures for me so far. We probably should just remove the FGA stuff from this sample. when I did the sample originally I wasnt planning on these becoming the core of the quickstart and in tended this as ajusta reference app thats why I didnt remove those
const credentials = getCIBACredentials(); | ||
const accessToken = credentials?.accessToken; | ||
const credentials = getCIBACredentials(); | ||
if (credentials?.accessToken) headers.Authorization = `Bearer ${credentials.accessToken}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why make this file less readable? I don't see wht this reformatting was needed?
|
||
```sh | ||
npm install | ||
bun install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep npm install as thats more widely used and available by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deepu105 Hi. I changed the README and .env.example files as per your suggestion regarding the file:
asynchronous-authorization/vercel-ai-next-js/src/lib/tools/shop-online.ts
Personally, I really like using template strings, but I have no objection to bringing back string concatenation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My comment wasn't about that; it was about reformatting the file in a way that a lot of stuff became single-line, etc. The use of single line conditions in JS were discouraged in most popular formatting tools.
a492190
to
f0d7875
Compare
f0d7875
to
2c8000a
Compare
Updating dependency packages for internal async-auth examples