-
Notifications
You must be signed in to change notification settings - Fork 23
feat(flagd): add custom cert path #131
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
gruebel
merged 2 commits into
open-feature:main
from
open-feature-forking:feat/add-custom-cert-path
Dec 27, 2024
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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
68 changes: 68 additions & 0 deletions
68
providers/openfeature-provider-flagd/tests/e2e/test_rpc_ssl.py
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 |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| from pathlib import Path | ||
|
|
||
| import pytest | ||
| from pytest_bdd import given, scenarios | ||
| from tests.e2e.conftest import SPEC_PATH | ||
| from tests.e2e.flagd_container import FlagdContainer | ||
| from tests.e2e.steps import wait_for | ||
|
|
||
| from openfeature import api | ||
| from openfeature.client import OpenFeatureClient | ||
| from openfeature.contrib.provider.flagd import FlagdProvider | ||
| from openfeature.contrib.provider.flagd.config import ResolverType | ||
| from openfeature.provider import ProviderStatus | ||
|
|
||
|
|
||
| @pytest.fixture(autouse=True, scope="module") | ||
| def client_name() -> str: | ||
| return "rpc" | ||
|
|
||
|
|
||
| @pytest.fixture(autouse=True, scope="module") | ||
| def resolver_type() -> ResolverType: | ||
| return ResolverType.RPC | ||
|
|
||
|
|
||
| @pytest.fixture(autouse=True, scope="module") | ||
| def port(): | ||
| return 8013 | ||
|
|
||
|
|
||
| @pytest.fixture(autouse=True, scope="module") | ||
| def image(): | ||
| return "ghcr.io/open-feature/flagd-testbed-ssl" | ||
|
|
||
|
|
||
| @given("a flagd provider is set", target_fixture="client") | ||
| @given("a provider is registered", target_fixture="client") | ||
| def setup_provider( | ||
| container: FlagdContainer, resolver_type, client_name, port | ||
| ) -> OpenFeatureClient: | ||
| try: | ||
| container.get_exposed_port(port) | ||
| except: # noqa: E722 | ||
| container.start() | ||
|
|
||
| path = ( | ||
| Path(__file__).parents[2] / "openfeature/test-harness/ssl/custom-root-cert.crt" | ||
| ) | ||
|
|
||
| api.set_provider( | ||
| FlagdProvider( | ||
| resolver_type=resolver_type, | ||
| port=int(container.get_exposed_port(port)), | ||
| timeout=1, | ||
| retry_grace_period=3, | ||
| tls=True, | ||
| cert_path=str(path.absolute()), | ||
| ), | ||
| client_name, | ||
| ) | ||
| client = api.get_client(client_name) | ||
| wait_for(lambda: client.get_provider_status() == ProviderStatus.READY) | ||
| return client | ||
|
|
||
|
|
||
| scenarios( | ||
| f"{SPEC_PATH}/specification/assets/gherkin/evaluation.feature", | ||
| ) |
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.