Skip to content
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

[feat]: add authorization identities to GoogleDriveLoader. #110

Merged
merged 3 commits into from
Apr 5, 2024

Conversation

rahul-trip
Copy link
Contributor

@rahul-trip rahul-trip commented Apr 2, 2024

Description: Add Google Drive document access identities to metadata
Dependencies: none
Documentation: GoogleDrive documentation update with load_auth usage to be updated with PR: langchain-ai/langchain#20065

load_auth: bool = False
"""Whether to load authorization identities."""

def _get_identity_metadata_from_id(self, id: str):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nits: can you add a typehint here, please (if I understand correctly, it should be -> List[str]?

authorized_identities = []
creds = self._load_credentials()
service = build("drive", "v3", credentials=creds) # Build the service
permissions = service.permissions().list(fileId=id).execute()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if a user has only view permissions and they don't have a permissions to retrieve permissions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @lkuligin
With current code in place, if a user is missing with permissions to retrieve permissions for a particular file, it will print a error message on stdout and move on for the next file.

@lkuligin
Copy link
Collaborator

lkuligin commented Apr 3, 2024

@rahul-trip thanks for your contribution! please, fix the remaining linting errors.

@rahul-trip rahul-trip requested a review from lkuligin April 3, 2024 15:24
@rahul-trip
Copy link
Contributor Author

Hi @lkuligin
I have fixed the linting issues, kindly approve the workflows to re-run the tests.

@lkuligin
Copy link
Collaborator

lkuligin commented Apr 3, 2024

@rahul-trip take a look at the Makefile, you can actually run these commands locally to save your time (if you install test dependencies)

@rahul-trip rahul-trip force-pushed the authorized_identities branch 2 times, most recently from 89b8fe8 to 6c897fa Compare April 4, 2024 04:08
Rahul Tripathi added 2 commits April 5, 2024 14:11
Signed-off-by: Rahul Tripathi <rauhl.psit.ec@gmail.com>
Signed-off-by: Rahul Tripathi <rauhl.psit.ec@gmail.com>
Signed-off-by: Rahul Tripathi <rauhl.psit.ec@gmail.com>
@rahul-trip
Copy link
Contributor Author

@rahul-trip take a look at the Makefile, you can actually run these commands locally to save your time (if you install test dependencies)

Hi @lkuligin
Thanks for the tip. I have fixed all the linting errors now. Kindly re-trigger the workflows for this PR. 🤞

@lkuligin lkuligin merged commit 7668e1f into langchain-ai:main Apr 5, 2024
13 checks passed
@lkuligin
Copy link
Collaborator

lkuligin commented Apr 5, 2024

congrats, and thanks for your contribution!

baskaryan pushed a commit to langchain-ai/langchain that referenced this pull request Apr 17, 2024
…gleDriveLoader. (#20065)

Description: Document update.

GoogleDriveLoader: Added documentation for `load_auth` a new argument in
document_loaders/GoogleDriveLoader.

Dependencies: None
Documentation:
https://python.langchain.com/docs/integrations/document_loaders/google_drive/

Associated PR: langchain-ai/langchain-google#110

Twitter handle: @rahul_tripathi2

Signed-off-by: Rahul Tripathi <rauhl.psit.ec@gmail.com>
Co-authored-by: Rahul Tripathi <rauhl.psit.ec@gmail.com>
hinthornw pushed a commit to langchain-ai/langchain that referenced this pull request Apr 26, 2024
…gleDriveLoader. (#20065)

Description: Document update.

GoogleDriveLoader: Added documentation for `load_auth` a new argument in
document_loaders/GoogleDriveLoader.

Dependencies: None
Documentation:
https://python.langchain.com/docs/integrations/document_loaders/google_drive/

Associated PR: langchain-ai/langchain-google#110

Twitter handle: @rahul_tripathi2

Signed-off-by: Rahul Tripathi <rauhl.psit.ec@gmail.com>
Co-authored-by: Rahul Tripathi <rauhl.psit.ec@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants