-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add support for dynamic expression in label application rules (#…
…233)
- Loading branch information
1 parent
a02e74f
commit 3697588
Showing
6 changed files
with
175 additions
and
2 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
24 changes: 24 additions & 0 deletions
24
...ma-api/src/main/java/org/hypertrace/graphql/label/schema/rule/DynamicLabelExpression.java
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,24 @@ | ||
package org.hypertrace.graphql.label.schema.rule; | ||
|
||
import graphql.annotations.annotationTypes.GraphQLField; | ||
import graphql.annotations.annotationTypes.GraphQLName; | ||
import graphql.annotations.annotationTypes.GraphQLNonNull; | ||
import java.util.List; | ||
|
||
@GraphQLName(DynamicLabelExpression.TYPE_NAME) | ||
public interface DynamicLabelExpression { | ||
String TYPE_NAME = "DynamicLabelExpression"; | ||
|
||
String LABEL_EXPRESSION_KEY = "labelExpression"; | ||
String TOKEN_EXTRACTION_RULES_KEY = "tokenExtractionRules"; | ||
|
||
@GraphQLField | ||
@GraphQLName(LABEL_EXPRESSION_KEY) | ||
@GraphQLNonNull | ||
String labelExpression(); | ||
|
||
@GraphQLField | ||
@GraphQLNonNull | ||
@GraphQLName(TOKEN_EXTRACTION_RULES_KEY) | ||
List<TokenExtractionRule> tokenExtractionRules(); | ||
} |
30 changes: 30 additions & 0 deletions
30
...chema-api/src/main/java/org/hypertrace/graphql/label/schema/rule/TokenExtractionRule.java
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,30 @@ | ||
package org.hypertrace.graphql.label.schema.rule; | ||
|
||
import graphql.annotations.annotationTypes.GraphQLField; | ||
import graphql.annotations.annotationTypes.GraphQLName; | ||
import graphql.annotations.annotationTypes.GraphQLNonNull; | ||
import javax.annotation.Nullable; | ||
|
||
@GraphQLName(TokenExtractionRule.TYPE_NAME) | ||
public interface TokenExtractionRule { | ||
String TYPE_NAME = "TokenExtractionRule"; | ||
|
||
String KEY_NAME = "key"; | ||
String ALIAS_KEY = "alias"; | ||
String REGEX_CAPTURE_KEY = "regexCapture"; | ||
|
||
@GraphQLField | ||
@GraphQLName(KEY_NAME) | ||
@GraphQLNonNull | ||
String key(); | ||
|
||
@GraphQLField | ||
@GraphQLName(ALIAS_KEY) | ||
@Nullable | ||
String alias(); | ||
|
||
@GraphQLField | ||
@GraphQLName(REGEX_CAPTURE_KEY) | ||
@Nullable | ||
String regexCapture(); | ||
} |
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