@@ -18,8 +18,7 @@ limitations under the License.
1818package archived
1919
2020import (
21- "github.com/apache/incubator-devlake/core/utils"
22- helper "github.com/apache/incubator-devlake/helpers/pluginhelper/api"
21+ commonArchived "github.com/apache/incubator-devlake/core/models/migrationscripts/archived"
2322)
2423
2524// QDevConn holds the essential information to connect to AWS S3
@@ -36,34 +35,12 @@ type QDevConn struct {
3635 RateLimitPerHour int `mapstructure:"rateLimitPerHour" json:"rateLimitPerHour"`
3736}
3837
39- func (conn * QDevConn ) Sanitize () QDevConn {
40- conn .SecretAccessKey = utils .SanitizeString (conn .SecretAccessKey )
41- return * conn
42- }
43-
4438// QDevConnection holds QDevConn plus ID/Name for database storage
4539type QDevConnection struct {
46- helper .BaseConnection `mapstructure:",squash"`
47- QDevConn `mapstructure:",squash"`
40+ commonArchived .BaseConnection `mapstructure:",squash"`
41+ QDevConn `mapstructure:",squash"`
4842}
4943
5044func (QDevConnection ) TableName () string {
5145 return "_tool_q_dev_connections"
5246}
53-
54- func (connection QDevConnection ) Sanitize () QDevConnection {
55- connection .QDevConn = connection .QDevConn .Sanitize ()
56- return connection
57- }
58-
59- func (connection * QDevConnection ) MergeFromRequest (target * QDevConnection , body map [string ]interface {}) error {
60- secretKey := target .SecretAccessKey
61- if err := helper .DecodeMapStruct (body , target , true ); err != nil {
62- return err
63- }
64- modifiedSecretKey := target .SecretAccessKey
65- if modifiedSecretKey == "" || modifiedSecretKey == utils .SanitizeString (secretKey ) {
66- target .SecretAccessKey = secretKey
67- }
68- return nil
69- }
0 commit comments