Commit c39145d 1 parent c5fd916 commit c39145d Copy full SHA for c39145d
File tree 2 files changed +16
-0
lines changed
main/java/io/kestra/plugin/aws/ecr
test/java/io/kestra/plugin/aws/ecr
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import io .kestra .core .models .annotations .Example ;
4
4
import io .kestra .core .models .annotations .Plugin ;
5
+ import io .kestra .core .models .annotations .PluginProperty ;
5
6
import io .kestra .core .models .tasks .Output ;
6
7
import io .kestra .core .models .tasks .RunnableTask ;
7
8
import io .kestra .core .runners .RunContext ;
8
9
import io .kestra .plugin .aws .AbstractConnection ;
9
10
import io .swagger .v3 .oas .annotations .media .Schema ;
11
+ import jakarta .validation .constraints .NotNull ;
10
12
import lombok .*;
11
13
import lombok .experimental .SuperBuilder ;
12
14
import software .amazon .awssdk .regions .Region ;
40
42
)
41
43
public class GetAuthToken extends AbstractConnection implements RunnableTask <GetAuthToken .TokenOutput > {
42
44
45
+ @ PluginProperty
46
+ @ Schema (
47
+ title = "Whether to encrypt the authorization token into the output." ,
48
+ description = "If set to true, it can be decrypted via the Pebble `decrypt()` function."
49
+ )
50
+ @ Builder .Default
51
+ @ NotNull
52
+ private Boolean encrypt = false ;
53
+
43
54
@ Override
44
55
public TokenOutput run (RunContext runContext ) throws Exception {
45
56
EcrClientBuilder ecrClientBuilder = EcrClient .builder ().credentialsProvider (this .credentials (runContext ));
@@ -63,6 +74,10 @@ public TokenOutput run(RunContext runContext) throws Exception {
63
74
token = token .substring (token .indexOf (":" ) + 1 );
64
75
}
65
76
77
+ if (Boolean .TRUE .equals (encrypt )) {
78
+ token = runContext .encrypt (token );
79
+ }
80
+
66
81
return TokenOutput .builder ()
67
82
.token (token )
68
83
.build ();
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ void run() throws Exception {
31
31
.accessKeyId (localstack .getAccessKey ())
32
32
.secretKeyId (localstack .getSecretKey ())
33
33
.region (localstack .getRegion ())
34
+ .encrypt (false )
34
35
.build ();
35
36
36
37
GetAuthToken .TokenOutput output = query .run (runContext );
You can’t perform that action at this time.
0 commit comments