-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Add support for an optional login and document level access control system. #624
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
Merged
mattgotteiner
merged 84 commits into
Azure-Samples:main
from
mattgotteiner:mattmsft/login-manual
Sep 25, 2023
Merged
Changes from 83 commits
Commits
Show all changes
84 commits
Select commit
Hold shift + click to select a range
438b2aa
conditional login button
76f3aed
fixing conditional login button
ff32732
updating frontend
4f74b28
snapshot: OBO flow works
220cd25
auth login working e2e
65151cb
cannot use env vars from frontend
7b3b18a
add adls gen2 setup
bda2125
more changes to prepdocs
9ccf99e
merging
9fae95e
fix auth + streaming
7cedaea
fixing up scripts
0a2f73c
add view action to manageacl
55ca848
Writing documentation
3558135
Merge remote-tracking branch 'upstream/main' into mattmsft/login
47d2707
doc WIP
bd3b4af
push auth config from server to client
e4f694d
updating docs, some minor code edits to be consistent
ba48b38
checkpoint
e93b02d
manual setup only for now
c2f5a13
remove manual logging
526d49a
remove optional print
581d08e
typo
3ffc497
hosting on localhost for redirect uri
d8a9498
remove ms graph sdk
e8e400a
run black, ruff
3a75fe9
dependency injection for AuthenticationHelper
138077a
encrypted token cache
337e699
more feedback
ebc1139
more feedback, port adlsgen2 to python
f4527f0
ruff, black
cc54ec2
Merge remote-tracking branch 'upstream/main' into mattmsft/login-manual
23a9ad4
ruff, black don't change files i didn't write
50c087f
Merge remote-tracking branch 'upstream/main' into mattmsft/login-manual
dbb269d
fix manage acl script
f3113a5
update start to support codespaces
3017b35
run black
542a964
formatting merge
b820c17
manual test, github codespaces localhost still works
mattgotteiner 305ee0c
Merge branch 'mattmsft/login-manual' of https://github.com/mattmsft/a…
20c0e1b
fixing prepdocs after manual test of azd up without auth
ec348c9
adding sh files; fixing script errors
mattgotteiner fb2bd60
debugging auth on codespaces
mattgotteiner 586ba15
running through setup instructions
9376504
Merge branch 'mattmsft/login-manual' of https://github.com/mattmsft/a…
5784598
note about consent
63fd749
change default scope
mattgotteiner 5cf2284
Merge branch 'mattmsft/login-manual' of https://github.com/mattmsft/a…
mattgotteiner d9416c8
merge
7aec1c1
switch to unordered list
0edcdb7
missing note
fb517b7
merge
739be38
addressing feedback...
50c0ee2
more feedback around
d405ada
doc strings
ce00a8e
formatting
e4b2d39
feedback on group claims
994d9c5
switch to transitivememberof
2e02d9c
Merge remote-tracking branch 'upstream/main' into mattmsft/login-manual
24420c1
readme feedback
30e4298
refactor approach to use common filtering method
51e3f10
more feedback
f19f875
refactoring
e60a66c
merge
277592d
writing tests
343c653
tests
8267bae
merge
493471b
test adls gen2 prepdocs
7d559de
Merge remote-tracking branch 'upstream/main' into mattmsft/login-manual
cfbffaa
fixing tests using env vars; adding adls gen2 tests
5464c9e
merge
bbe19d0
broken?
bbbbcf8
fixing tests
ef7835c
more tests
7059f14
fixing CI errors
846eba0
feedback
d619b69
fix script
0ec62fc
fix script
e90ccd1
fix script
081c29a
bicep deployment; add documentation for troubleshooting
c1b65fe
lowercase true for env comparison
17417eb
feedback
74cb414
fix sh syntax errors
de98f87
fixing syntax errors
f6fb977
Script fixes
mattgotteiner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,22 @@ | ||
| from abc import ABC, abstractmethod | ||
| from typing import Any | ||
|
|
||
| from core.authentication import AuthenticationHelper | ||
|
|
||
| class AskApproach(ABC): | ||
|
|
||
| class Approach(ABC): | ||
| def build_filter(self, overrides: dict[str, Any], auth_claims: dict[str, Any]) -> str: | ||
| exclude_category = overrides.get("exclude_category") or None | ||
| security_filter = AuthenticationHelper.build_security_filters(overrides, auth_claims) | ||
| filters = [] | ||
| if exclude_category: | ||
| filters.append("category ne '{}'".format(exclude_category.replace("'", "''"))) | ||
| if security_filter: | ||
| filters.append(security_filter) | ||
| return None if len(filters) == 0 else " and ".join(filters) | ||
|
|
||
|
|
||
| class AskApproach(Approach): | ||
| @abstractmethod | ||
| async def run(self, q: str, overrides: dict[str, Any]) -> dict[str, Any]: | ||
| async def run(self, q: str, overrides: dict[str, Any], auth_claims: dict[str, Any]) -> dict[str, Any]: | ||
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.