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

Extract IMDS test fixture from S3 fixture #117324

Merged
merged 6 commits into from
Nov 25, 2024

Conversation

DaveCTurner
Copy link
Contributor

@DaveCTurner DaveCTurner commented Nov 22, 2024

The S3 and IMDS services are separate things in practice, we shouldn't
be conflating them as we do today. This commit introduces a new
independent test fixture just for the IMDS endpoint and migrates the
relevant tests to use it.

Relates ES-9984

@DaveCTurner DaveCTurner added >test Issues or PRs that are addressing/adding tests WIP :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs v9.0.0 v8.17.0 labels Nov 22, 2024
@DaveCTurner

This comment was marked as outdated.

@DaveCTurner DaveCTurner force-pushed the 2024/11/22/imds-fixture branch 2 times, most recently from fc82403 to c0427bf Compare November 22, 2024 13:16
The S3 and IMDS services are separate things in practice, we shouldn't
be conflating them as we do today. This commit introduces a new
independent test fixture just for the IMDS endpoint and migrates the
relevant tests to use it.

Relates ES-9984
@DaveCTurner DaveCTurner force-pushed the 2024/11/22/imds-fixture branch from c0427bf to 65c5fa1 Compare November 22, 2024 13:52
@DaveCTurner DaveCTurner marked this pull request as ready for review November 22, 2024 15:04
Copy link
Contributor

@nicktindall nicktindall left a comment

Choose a reason for hiding this comment

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

LGTM!

@DaveCTurner DaveCTurner merged commit b0c4976 into elastic:main Nov 25, 2024
16 checks passed
@DaveCTurner DaveCTurner deleted the 2024/11/22/imds-fixture branch November 25, 2024 08:01
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Nov 25, 2024
Rephrase the authorization check in `S3HttpFixture` in terms of a
predicate provided by the caller so that there's no need for a separate
subclass that handles session tokens, and so that it can support
auto-generated credentials more naturally.

Also adapts `Ec2ImdsHttpFixture` to dynamically generate credentials
this way.

Also extracts the STS fixture in `S3HttpFixtureWithSTS` into a separate
service, similarly to elastic#117324, and adapts this new fixture to
dynamically generate credentials too.
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Nov 25, 2024
Rephrase the authorization check in `S3HttpFixture` in terms of a
predicate provided by the caller so that there's no need for a separate
subclass that handles session tokens, and so that it can support
auto-generated credentials more naturally.

Also adapts `Ec2ImdsHttpFixture` to dynamically generate credentials
this way.

Also extracts the STS fixture in `S3HttpFixtureWithSTS` into a separate
service, similarly to elastic#117324, and adapts this new fixture to
dynamically generate credentials too.

Relates ES-9984
@DaveCTurner DaveCTurner removed the WIP label Nov 25, 2024
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Nov 25, 2024
The S3 and IMDS services are separate things in practice, we shouldn't
be conflating them as we do today. This commit introduces a new
independent test fixture just for the IMDS endpoint and migrates the
relevant tests to use it.

Relates ES-9984

Backport of elastic#117324 to 8.x
elasticsearchmachine pushed a commit that referenced this pull request Nov 25, 2024
The S3 and IMDS services are separate things in practice, we shouldn't
be conflating them as we do today. This commit introduces a new
independent test fixture just for the IMDS endpoint and migrates the
relevant tests to use it.

Relates ES-9984

Backport of #117324 to 8.x
DaveCTurner added a commit that referenced this pull request Nov 26, 2024
Rephrase the authorization check in `S3HttpFixture` in terms of a
predicate provided by the caller so that there's no need for a separate
subclass that handles session tokens, and so that it can support
auto-generated credentials more naturally.

Also adapts `Ec2ImdsHttpFixture` to dynamically generate credentials
this way.

Also extracts the STS fixture in `S3HttpFixtureWithSTS` into a separate
service, similarly to #117324, and adapts this new fixture to
dynamically generate credentials too.

Relates ES-9984
alexey-ivanov-es pushed a commit to alexey-ivanov-es/elasticsearch that referenced this pull request Nov 28, 2024
The S3 and IMDS services are separate things in practice, we shouldn't
be conflating them as we do today. This commit introduces a new
independent test fixture just for the IMDS endpoint and migrates the
relevant tests to use it.

Relates ES-9984
alexey-ivanov-es pushed a commit to alexey-ivanov-es/elasticsearch that referenced this pull request Nov 28, 2024
Rephrase the authorization check in `S3HttpFixture` in terms of a
predicate provided by the caller so that there's no need for a separate
subclass that handles session tokens, and so that it can support
auto-generated credentials more naturally.

Also adapts `Ec2ImdsHttpFixture` to dynamically generate credentials
this way.

Also extracts the STS fixture in `S3HttpFixtureWithSTS` into a separate
service, similarly to elastic#117324, and adapts this new fixture to
dynamically generate credentials too.

Relates ES-9984
elasticsearchmachine pushed a commit that referenced this pull request Nov 29, 2024
Running with FIPS approved mode requires secret keys to be at least 114
bits long.

Relates: #117324 Resolves: #117596 Resolves: #117709 Resolves: #117710
Resolves: #117711 Resolves: #117712
ywangd added a commit to ywangd/elasticsearch that referenced this pull request Nov 29, 2024
Running with FIPS approved mode requires secret keys to be at least 114
bits long.

Relates: elastic#117324 Resolves: elastic#117596 Resolves: elastic#117709 Resolves: elastic#117710
Resolves: elastic#117711 Resolves: elastic#117712
(cherry picked from commit 24bc505)

# Conflicts:
#	modules/repository-s3/src/javaRestTest/java/org/elasticsearch/repositories/s3/RepositoryS3RestReloadCredentialsIT.java
#	muted-tests.yml
#	test/fixtures/s3-fixture/src/main/java/fixture/s3/S3HttpFixtureWithSTS.java
elasticsearchmachine pushed a commit that referenced this pull request Nov 29, 2024
Running with FIPS approved mode requires secret keys to be at least 114
bits long.

Relates: #117324 Resolves: #117596 Resolves: #117709 Resolves: #117710
Resolves: #117711 Resolves: #117712
(cherry picked from commit 24bc505)

# Conflicts:
#	modules/repository-s3/src/javaRestTest/java/org/elasticsearch/repositories/s3/RepositoryS3RestReloadCredentialsIT.java
#	muted-tests.yml
#	test/fixtures/s3-fixture/src/main/java/fixture/s3/S3HttpFixtureWithSTS.java
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Nov 29, 2024
Rephrase the authorization check in `S3HttpFixture` in terms of a
predicate provided by the caller so that there's no need for a separate
subclass that handles session tokens, and so that it can support
auto-generated credentials more naturally.

Also adapts `Ec2ImdsHttpFixture` to dynamically generate credentials
this way.

Also extracts the STS fixture in `S3HttpFixtureWithSTS` into a separate
service, similarly to elastic#117324, and adapts this new fixture to
dynamically generate credentials too.

Relates ES-9984

Backport of elastic#117458 to 8.x
elasticsearchmachine pushed a commit that referenced this pull request Nov 29, 2024
Rephrase the authorization check in `S3HttpFixture` in terms of a
predicate provided by the caller so that there's no need for a separate
subclass that handles session tokens, and so that it can support
auto-generated credentials more naturally.

Also adapts `Ec2ImdsHttpFixture` to dynamically generate credentials
this way.

Also extracts the STS fixture in `S3HttpFixtureWithSTS` into a separate
service, similarly to #117324, and adapts this new fixture to
dynamically generate credentials too.

Relates ES-9984

Backport of #117458 to 8.x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >test Issues or PRs that are addressing/adding tests v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants