-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: search identities by dashboard alias (#4569)
- Loading branch information
1 parent
7ae2623
commit 5c02c1e
Showing
16 changed files
with
346 additions
and
138 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import enum | ||
from dataclasses import dataclass | ||
|
||
IDENTIFIER_ATTRIBUTE = "identifier" | ||
DASHBOARD_ALIAS_ATTRIBUTE = "dashboard_alias" | ||
DASHBOARD_ALIAS_SEARCH_PREFIX = f"{DASHBOARD_ALIAS_ATTRIBUTE}:" | ||
|
||
|
||
class EdgeIdentitySearchType(enum.Enum): | ||
EQUAL = "EQUAL" | ||
BEGINS_WITH = "BEGINS_WITH" | ||
|
||
|
||
@dataclass | ||
class EdgeIdentitySearchData: | ||
search_term: str | ||
search_type: EdgeIdentitySearchType | ||
search_attribute: str | ||
|
||
@property | ||
def dynamo_search_method(self): | ||
return ( | ||
"eq" if self.search_type == EdgeIdentitySearchType.EQUAL else "begins_with" | ||
) | ||
|
||
@property | ||
def dynamo_index_name(self): | ||
return f"environment_api_key-{self.search_attribute}-index" |
This file contains 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 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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.