Skip to content
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

feat: update review parsing and serialization #22

Merged
merged 1 commit into from
May 16, 2022

Conversation

csmig
Copy link
Member

@csmig csmig commented May 16, 2022

Resolves #20
Resolves #18
Resolves #11
Resolves #10

  • Minimum STIG Manager API version is updated from 1.1.0 => 1.2.7

  • Adds support for the resultEngine property of Review

  • The serializers now attempt to fetch configuration options from Collection.metadata.importOptions. If this metadata property is absent, a default configuration object which mimics previous serialization behavior is used. Support for configuring custom options will be considered in future PRs. See the STIG Manager API definition for property descriptions.

 const defaultImportOptions = {
  autoStatus: 'saved',
  unreviewed: 'commented',
  unreviewedCommented: 'informational',
  emptyDetail: 'replace',
  emptyComment: 'ignore',
  allowCustom: false
}
  • The serializers now reference Collection field and status settings when calculating whether an autoStatus setting can be honored.

  • Watcher now requests scope stig-manager:user:read from the OIDC Provider. If Watcher's token does not include this scope, Watcher is unable to honor the Collection property metadata.importOptions.autoStatus = 'accepted' (See below).

  • The serializers will optionally reference Collection Grant settings in order to calculate whether an autoStatus = "accepted" setting can be honored. Watcher now attempts to call API endpoint /user to learn the Watcher userId. If Watcher is denied access to this endpoint (most likely because Watcher's token is missing scope stig-manager:user:read) it will not attempt to set accepted status on any Reviews.

  • To avoid Collection settings and metadata from becoming excessively stale, Watcher now makes calls to /collection/{collectionId} and /user at ten minute intervals. Support for configuring this interval will be considered in future PRs, as will alternative approaches to polling.

@csmig csmig changed the title feat: update review parsing feat: update review parsing and serialization May 16, 2022
@csmig csmig merged commit adfb705 into NUWCDIVNPT:main May 16, 2022
@csmig csmig deleted the import-options-pr branch June 6, 2022 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment