swagger-api/swagger-codegen

password in toString in generated model

开放

#2,662 创建于 2016年4月20日

 (11 条评论) (6 个反应) (0 位负责人)HTML (5,474 个派生)batch import
Enhancement: Generalhelp wanted

仓库指标

星标
 (12,701 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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?

贡献者指南