-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from rursprung/initial-featureset
implement first version (basic HTTP actions support, basic auth)
- Loading branch information
Showing
42 changed files
with
2,538 additions
and
232 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
57 changes: 0 additions & 57 deletions
57
src/main/java/com/example/change/ClearPasswordsChange.java
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
src/main/java/com/example/change/PrefixedCreateTableChange.java
This file was deleted.
Oops, something went wrong.
80 changes: 0 additions & 80 deletions
80
src/main/java/com/example/precondition/HasPasswordColumnPrecondition.java
This file was deleted.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
src/main/java/liquibase/ext/opensearch/change/HttpRequestChange.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,41 @@ | ||
package liquibase.ext.opensearch.change; | ||
|
||
import liquibase.change.AbstractChange; | ||
import liquibase.change.ChangeMetaData; | ||
import liquibase.change.DatabaseChange; | ||
import liquibase.database.Database; | ||
import liquibase.ext.opensearch.statement.HttpRequestStatement; | ||
import liquibase.statement.SqlStatement; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import java.util.Optional; | ||
|
||
@DatabaseChange(name = "httpRequest", | ||
description = "Execute an arbitrary HTTP request with the provided payload", | ||
priority = ChangeMetaData.PRIORITY_DATABASE) | ||
@NoArgsConstructor | ||
@Getter | ||
@Setter | ||
public class HttpRequestChange extends AbstractChange { | ||
|
||
private String method; | ||
private String path; | ||
private String body; | ||
|
||
@Override | ||
public String getConfirmationMessage() { | ||
return String.format("executed the HTTP %s request against %s (with a body of size %d)", | ||
this.getMethod(), | ||
this.getPath(), | ||
Optional.ofNullable(this.getBody()).map(String::length).orElse(0)); | ||
} | ||
|
||
@Override | ||
public SqlStatement[] generateStatements(final Database database) { | ||
return new SqlStatement[] { | ||
new HttpRequestStatement(this.getMethod(), this.getPath(), this.getBody()) | ||
}; | ||
} | ||
} |
Oops, something went wrong.