swagger-api/swagger-codegen

password in toString in generated model

オープン

#2,662 opened on 2016/04/20

 (11 件のコメント) (6 件のリアクション) (0 人の担当者)HTML (5,474 件のフォーク)batch import
Enhancement: Generalhelp wanted

Repository metrics

Stars
 (12,701 個のスター)
PR merge metrics
 (PR metrics pending)

説明

When using format "password", e.g.

  credentials:
    type: object
    properties:
      username:
        type: string
      password:
        type: string
        format: password
    required:
    - username
    - password

the field "password" is contained in the toString method of the generated model class.

In my opinion, that's a security issue (you don't want client passwords appearing in log files etc.)

Would it make sense to change the corresponding line in toString to:

sb.append(" password: ").append("<protected>").append("\n");

whenever the format "password" is used?

コントリビューターガイド