swagger-api/swagger-codegen

password in toString in generated model

Open

#2,662 opened on Apr 20, 2016

View on GitHub
 (11 comments) (6 reactions) (0 assignees)HTML (12,701 stars) (5,474 forks)batch import
Enhancement: Generalhelp wanted

Description

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?

Contributor guide

password in toString in generated model · swagger-api/swagger-codegen#2662 | Good First Issue