@@ -17,6 +17,29 @@ export const schema = {
17
17
type : 'object' ,
18
18
} ,
19
19
} ,
20
+ pii_config : {
21
+ type : 'object' ,
22
+ required : [ 'log_fields' ] ,
23
+ properties : {
24
+ log_fields : {
25
+ type : 'array' ,
26
+ items : {
27
+ type : 'string' ,
28
+ enum : [ 'first_name' , 'last_name' , 'username' , 'email' , 'phone' , 'address' ] ,
29
+ } ,
30
+ } ,
31
+ method : {
32
+ type : 'string' ,
33
+ enum : [ 'mask' , 'hash' ] ,
34
+ default : 'hash' ,
35
+ } ,
36
+ algorithm : {
37
+ type : 'string' ,
38
+ enum : [ 'xxhash' ] ,
39
+ default : 'xxhash' ,
40
+ } ,
41
+ } ,
42
+ } ,
20
43
} ,
21
44
required : [ 'name' ] ,
22
45
} ,
@@ -75,23 +98,21 @@ export default class LogStreamsHandler extends DefaultAPIHandler {
75
98
76
99
if ( ! logStreams ) return ;
77
100
78
- const changes = await this . calcChanges ( assets ) . then ( ( changes ) => {
79
- return {
80
- ...changes ,
81
- update : changes . update . map ( ( update : LogStream ) => {
82
- if ( update . type === 'eventbridge' || update . type === 'eventgrid' ) {
83
- delete update . sink ;
84
- }
85
- if ( update . status === 'suspended' ) {
86
- // @ts -ignore because while status is usually expected for update payloads, it is ok to be omitted
87
- // for suspended log streams. Setting as `active` in these instances would probably be ok
88
- // but bit presumptuous, let suspended log streams remain suspended.
89
- delete update . status ;
90
- }
91
- return update ;
92
- } ) ,
93
- } ;
94
- } ) ;
101
+ const changes = await this . calcChanges ( assets ) . then ( ( changes ) => ( {
102
+ ...changes ,
103
+ update : changes . update . map ( ( update : LogStream ) => {
104
+ if ( update . type === 'eventbridge' || update . type === 'eventgrid' ) {
105
+ delete update . sink ;
106
+ }
107
+ if ( update . status === 'suspended' ) {
108
+ // @ts -ignore because while status is usually expected for update payloads, it is ok to be omitted
109
+ // for suspended log streams. Setting as `active` in these instances would probably be ok
110
+ // but bit presumptuous, let suspended log streams remain suspended.
111
+ delete update . status ;
112
+ }
113
+ return update ;
114
+ } ) ,
115
+ } ) ) ;
95
116
96
117
await super . processChanges ( assets , changes ) ;
97
118
}
0 commit comments