Commit Graph

135 Commits

Author SHA1 Message Date
Sida Chen
1234a8d2f0
Merge pull request #741 from KeyboardNerd/parallel_download
v3: Analyze layer content in parallel
2019-03-20 12:50:15 -04:00
Sida Chen
88f506918b v3: Analyze layer content in parallel 2019-03-20 12:04:14 -04:00
Ales Raszka
f2ce8325b9 Convert: return nil when detector is empty
When PotentialNamespace is used detector is empty and
DetectorFromDatabaseModel() should return nil instead of empty object.
2019-03-20 16:00:46 +01:00
Sida Chen
b3fe95e152
Merge pull request #724 from KeyboardNerd/ref
database: move db logic to dbutil
2019-03-06 15:25:04 -05:00
Sida Chen
1b9ed99646 database: Move db logic to dbutil
Move all transaction related logic to dbutil to simplify and later unify
the db interface.
2019-03-06 15:22:21 -05:00
Sida Chen
046b0e49d1 Add missing licenses 2019-03-05 11:42:59 -05:00
Sida Chen
465687fa94 clair: Add more logging on ancestry cache hit 2019-02-26 10:26:49 -05:00
Sida Chen
5b2376498b clair: Use builder pattern for constructing ancestry
- Add Ancestry builder
- Change RPC to use the ancestry builder
2019-02-26 10:26:49 -05:00
Sida Chen
dd239762f6 v3: Move services to top of the file 2019-02-22 11:31:47 -05:00
Sida Chen
32b11e54eb api/v3: Add feature type to API feature
API now returns every feature found by the detectors and also indicates
the type of feature.
2019-02-19 17:03:44 -05:00
Tamal Saha
0ed4126240 Fix cert and key file mix up
Signed-off-by: Tamal Saha <tamal@appscode.com>
2019-01-02 12:31:58 -08:00
Sida Chen
69c0c84348 api: Rename detector type to DType
Rename detector type to DType because all reserved key words should be
avoided used as type name or variable name.
2018-10-08 14:34:19 -04:00
Sida Chen
48427e9b88 api: Add detectors for RPC
Change the V3 implementation to accommondate the detectors.
2018-10-08 10:42:40 -04:00
Sida Chen
9f5d1ea4e1 v3: associate feature and namespace with detector 2018-10-01 11:04:08 -04:00
Sida Chen
f98ff58afd
Merge pull request #619 from KeyboardNerd/sidac/rm_layer
database: Remove LayerWithContent from interface
2018-09-13 14:36:26 -04:00
Sida Chen
e160616723 database: Use LayerWithContent as Layer 2018-09-13 13:21:39 -04:00
Jimmy Zelinskie
089a4e0f0a
Merge pull request #617 from jzelinskie/grpc-refactor
Introduce pkg/grpcutil
2018-09-11 14:57:13 -04:00
Jimmy Zelinskie
1ec2759550 pkg/grpcutil: init
This change refactors gRPC code used within the v3 API package into
generic code that can be used for managing gRPC and gRPC Gateway.
2018-09-11 14:46:52 -04:00
Sida Chen
6c69377343
Merge pull request #614 from KeyboardNerd/sidac/simplify
Replace Ancestry with AncestryWithContent struct in database models
2018-09-11 10:50:53 -04:00
Jimmy Zelinskie
dc6be5d1b0 api: remove handleShutdown func
This function was used for handling errors in the graceful library and
was never necessary for the v3 API.
2018-09-10 13:26:53 -04:00
Sida Chen
5d725e67b0 Replace Ancestry with AncestryWithContent struct in database models
As one of the steps to simplifies the codebase, the AncestryWithContent
struct is renamed to Ancestry, and Ancestry is removed. It will cause
the PostAncestry request to be slower.
2018-09-10 12:48:23 -04:00
Jimmy Zelinskie
0565938956 pkg/pagination: add token type
This change pulls as much pagination logic out of the database
implementation as possible. Database implementations should now be able
to marshal whatever state they need into opaque tokens with the
utilities in the pagination package.
2018-09-07 16:26:56 -04:00
Jimmy Zelinskie
30644fcc01 api: remove dependency on graceful
This library has no longer been needed since Go 1.8.
2018-09-06 16:56:33 -04:00
Sida Chen
2bbbad393b
Merge pull request #605 from KeyboardNerd/sidchen/feature
Implement Ancestry Layer-wise feature API
2018-09-06 14:08:56 -04:00
Sida Chen
2827b9342b Update Database and Worker implementation for layer-wise feature
Feature extraction algorithm is changed to associate features with
ancestry layer. Database is updated to keep the relationship.
2018-09-06 13:56:03 -04:00
Jean Michel MacKay
9df4f5bd70 Adding httputil and version packages
- Debian/RHEL/Oracle vulnsrc now use httputil to download files
- httputil sets the User-Agent to the requests as Clair/<version> (https://github.com/coreos/clair/)
- httputil holds Status2xx() which returns if the response is a http success (2xx)
- GetClientAddr moved from api/httputil to pkg/httputil
- the version packge holds a Version string which is set at build time from the git tag and sha
- the .git directory was removed from .dockerignore so that we can use the git tag to set the version
2018-09-05 14:56:39 -04:00
Sida Chen
4b64151330 Update gRPC server implementation 2018-09-05 11:34:06 -04:00
Sida Chen
6a44052e31 Update Clair V3 API to provide layer-wise feature 2018-09-05 11:33:27 -04:00
Sida Chen
d28f3214ce Add Status endpoint with Clair configuration
Implement a status endpoint providing the current lister/detector in
the current instance of Clair.
2018-08-30 16:55:18 -04:00
Jimmy Zelinskie
f550dd16a0 api/v3: remove dependency on google empty message 2018-04-23 15:49:34 -04:00
Jimmy Zelinskie
d7a751e0d4 api/v3: prototool format 2018-04-23 15:32:03 -04:00
Jimmy Zelinskie
6b9f668ea0 api/v3/clairpb: document and regenerate protos 2018-04-10 14:47:57 -04:00
Jimmy Zelinskie
a5b3e747a0
Merge pull request #538 from jzelinskie/dockerize-protogen
generate protobufs in docker
2018-04-04 16:55:50 -04:00
Jimmy Zelinskie
ec5014f8a1 api/v3/clairpb: regen protobufs 2018-04-04 16:17:49 -04:00
Jimmy Zelinskie
389b6e9927 api/v3/clairpb: generate protobufs in docker
This removes the requirement of the build machine having protobuf and
any extensions installed.
2018-04-04 16:16:50 -04:00
Sida Chen
a75b8ac7ff api,database: updated version_format documentation.
Version format documentation is updated in the example of feature
struct and created in clair.proto along with accordingly generated
swagger and protobuf files.

Fixes #514
2018-02-02 00:59:11 -05:00
Jimmy Zelinskie
4491bedf2e database/pgsql: move token lib 2017-08-21 16:25:13 -04:00
Sida Chen
0151dbaef8 API: change api port to api addr, rename RunV2 to Run.
Fixes #446
2017-08-18 18:24:34 -04:00
Sida Chen
58022d97e3 api: renamed V2 API to V3 API for consistency. 2017-08-16 17:26:53 -04:00
Sida Chen
a378cb070c API: drop v1 api, changed v2 api for Clair v3. 2017-08-10 11:19:08 -04:00
Jimmy Zelinskie
6c9a131b09 Merge pull request #408 from KeyboardNerd/grpc
v2 api with gRPC and gRPC gateway
2017-06-30 17:33:57 -04:00
Sida Chen
c6f0eaa3c8 api: fix remote addr shows reverse proxy addr problem
Uses the first ip addr in X-forwarded-for as the client's remote addr if it exists
otherwise, fall back to use default http.Request.RemoteAddr
2017-06-16 10:08:58 -04:00
Sida Chen
a4edf38566 api: v2 api with gRPC and gRPC-gateway
Newly designed API defines Ancestry as a set of layers
and shrinked the api to only the most used apis:
post ancestry, get layer, get notification, delete notification

Fixes #98
2017-06-13 15:58:10 -04:00
Sida Chen
bffa6499b7 added support for detect multiple namespaces in a layer
created table layer_namespace to store the many to many unique mapping of layers and namespaces
changed v1 api to provide a list of namespaces for each layer
changed namespace detector to use all registered detectors to detect namespaces
updated tests for multiple namespaces

Fixes #150
2017-05-24 17:01:51 -04:00
Sida Chen
9306e99368 converted to structured logging by using logrus
changed from capnslog to logrus for logging JSON structured message.

finished issue #383
2017-05-04 13:59:57 -04:00
Kevin Burke
6a50bbb8b8
api: fix 404 error logging
The first value is an integer and the second value is a string and the
format string has these backwards, leading to %!s(int=404) appearing
in the logs instead of "404".
2017-04-03 16:08:18 -07:00
Jimmy Zelinskie
6a569fd945 move config to main / decentralize config
This puts config in its relevant location and moves functions around
loading config files into the main package.

As a side effect of removing cyclic imports for the API config, the
context library is no longer used.
2017-01-27 00:36:13 -05:00
Jimmy Zelinskie
889615276a clair: move worker to top level package 2017-01-26 18:24:04 -05:00
Jimmy Zelinskie
9c63a63944 clair: mv updater clair and mv severity to db 2017-01-22 23:20:56 -05:00
Jimmy Zelinskie
00e4f70972 pkg/stopper: init from utils.Stopper 2017-01-22 23:02:51 -05:00