forked from RedHatInsights/compliance-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hardcoded latest versions, gql-cache, import-ssg task (RedHatInsights…
…#413) * Fix transient profile test failure (RedHatInsights#407) Signed-off-by: Andrew Kofink <[email protected]> * Hardcode latest RHEL supported versions (RedHatInsights#408) * Hardcode latest RHEL supported versions * Add cache for latest supported versions * Freeze constant * Return an AR relation * Properly search for match ref_id/version * Task to import supported SSG benchmarks (RedHatInsights#412) * Task to import supported SSG benchmarks * Regex way of getting RHEL number Co-Authored-By: Andrew Kofink <[email protected]> * Fix rubocop Co-authored-by: Andrew Kofink <[email protected]> * Introduce graphql-cache (RedHatInsights#411) * GQL-cache POC * Don't cache batched fields * Cache lazy types * Wait for promises before saving to cache * Re-enable promise fields and to_s * Use hiredis * Uncomment timeout in schema * Rubocop fixes * Fix href/label test * Add benchmarks API endpoint (RedHatInsights#409) Signed-off-by: Andrew Kofink <[email protected]> * Fixes for rake tasks (RedHatInsights#414) * Require HostInventoryNotFound * Execute instead of invoking import SSG task * Add specific config for cache redis (RedHatInsights#415) Co-authored-by: Andrew Kofink <[email protected]> Co-authored-by: Andrew Kofink <[email protected]>
- Loading branch information
1 parent
e065c89
commit 414e801
Showing
27 changed files
with
239 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# frozen_string_literal: true | ||
|
||
# API for Benchmarks | ||
class BenchmarksController < ApplicationController | ||
def index | ||
render json: benchmarks | ||
end | ||
|
||
def show | ||
render json: benchmark | ||
end | ||
|
||
private | ||
|
||
def benchmarks | ||
@benchmarks ||= BenchmarkSerializer.new(authorize(scope_search), metadata) | ||
end | ||
|
||
def benchmark | ||
@benchmark ||= BenchmarkSerializer.new( | ||
authorize(resource.find(params[:id])) | ||
) | ||
end | ||
|
||
def scope | ||
policy_scope(resource) | ||
end | ||
|
||
def resource | ||
Xccdf::Benchmark | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
# JSON API serialization for an OpenSCAP Benchmark | ||
class BenchmarkSerializer | ||
include FastJsonapi::ObjectSerializer | ||
attributes :ref_id, :title, :version, :description | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.