New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement friendly field aliases (like "date" instead of "public_date" and "severity" instead of "threat_severity") for --fields option #30

Closed
ryran opened this Issue Nov 7, 2016 · 1 comment

Comments

Projects
None yet
1 participant
@ryran
Owner

ryran commented Nov 7, 2016

Yep!

@ryran ryran added the enhancement label Nov 7, 2016

@ryran ryran self-assigned this Nov 7, 2016

@ryran ryran changed the title from implement friendly field aliases (like "date" instead of "public_date" and "impact" instead of "threat_severity") for --fields option; make fields case-insensitive to implement friendly field aliases (like "date" instead of "public_date" and "severity" instead of "threat_severity") for --fields option Nov 8, 2016

ryran added a commit that referenced this issue Nov 8, 2016

@ryran

This comment has been minimized.

Show comment
Hide comment
@ryran

ryran Nov 8, 2016

Owner

DONE!

$ rhsecapi --help
...
CVE DISPLAY OPTIONS:
  -f, --fields FIELDS   Customize field display via comma-separated case-
                        insensitive list (default: threat_severity,
                        public_date, bugzilla, affected_release,
                        package_state); see --all-fields option for full list
                        of official API-provided fields; shorter field
                        aliases: threat_severity → severity, public_date →
                        date, affected_release → fixed_releases or fixed or
                        releases, package_state → fix_states or states;
                        optionally prepend FIELDS with plus (+) sign to add
                        fields to the default (e.g., '-f +iava,cvss3') or a
                        caret (^) to remove fields from the default (e.g., '-f
                        ^bugzilla,severity')
...

$ rhsecapi CVE-2016-6302 -f janky
rhsecapi: Field 'janky' is not a supported field; valid fields:
threat_severity, public_date, iava, cwe, cvss, cvss3, bugzilla, acknowledgement, details, statement, mitigation, upstream_fix, references, affected_release, package_state, severity, releases, fixed_releases, states, fix_states, date, fixed

$ rhsecapi CVE-2016-6302 -vf releases,severity
DEBUG THREADS: '1'
Getting 'https://access.redhat.com/labs/securitydataapi/cve/CVE-2016-6302.json' ...
Valid Red Hat CVE results retrieved: 1 of 1
DEBUG FIELDS: 'affected_release,threat_severity'

CVE-2016-6302
  SEVERITY: Moderate Impact
  FIXED_RELEASES:
   Red Hat Enterprise Linux 6 [openssl-1.0.1e-48.el6_8.3]: RHSA-2016:1940
   Red Hat Enterprise Linux 7 [openssl-1:1.0.1e-51.el7_2.7]: RHSA-2016:1940
Owner

ryran commented Nov 8, 2016

DONE!

$ rhsecapi --help
...
CVE DISPLAY OPTIONS:
  -f, --fields FIELDS   Customize field display via comma-separated case-
                        insensitive list (default: threat_severity,
                        public_date, bugzilla, affected_release,
                        package_state); see --all-fields option for full list
                        of official API-provided fields; shorter field
                        aliases: threat_severity → severity, public_date →
                        date, affected_release → fixed_releases or fixed or
                        releases, package_state → fix_states or states;
                        optionally prepend FIELDS with plus (+) sign to add
                        fields to the default (e.g., '-f +iava,cvss3') or a
                        caret (^) to remove fields from the default (e.g., '-f
                        ^bugzilla,severity')
...

$ rhsecapi CVE-2016-6302 -f janky
rhsecapi: Field 'janky' is not a supported field; valid fields:
threat_severity, public_date, iava, cwe, cvss, cvss3, bugzilla, acknowledgement, details, statement, mitigation, upstream_fix, references, affected_release, package_state, severity, releases, fixed_releases, states, fix_states, date, fixed

$ rhsecapi CVE-2016-6302 -vf releases,severity
DEBUG THREADS: '1'
Getting 'https://access.redhat.com/labs/securitydataapi/cve/CVE-2016-6302.json' ...
Valid Red Hat CVE results retrieved: 1 of 1
DEBUG FIELDS: 'affected_release,threat_severity'

CVE-2016-6302
  SEVERITY: Moderate Impact
  FIXED_RELEASES:
   Red Hat Enterprise Linux 6 [openssl-1.0.1e-48.el6_8.3]: RHSA-2016:1940
   Red Hat Enterprise Linux 7 [openssl-1:1.0.1e-51.el7_2.7]: RHSA-2016:1940

@ryran ryran closed this Nov 8, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment