Commit ef9d6661 authored by ale's avatar ale
Browse files

Remove dependency on ai3/tools/webappdb

Internalize the webappdb.App type (part of CMSInfo).
parent fbcb0e43
......@@ -5,12 +5,12 @@ go 1.14
require (
git.autistici.org/ai3/go-common v0.0.0-20210118064555-73f00db54723
git.autistici.org/ai3/tools/aux-db v0.0.0-20210123151036-db9b4b9a323e
git.autistici.org/ai3/tools/webappdb v0.0.0-20210117172932-02a098c04745
git.autistici.org/id/auth v0.0.0-20210117173158-5b5aa9684fa2
git.autistici.org/id/go-sso v0.0.0-20210117165919-e56e6579953d
git.autistici.org/id/usermetadb v0.0.0-20210117202739-301b3d00f818
github.com/go-ldap/ldap/v3 v3.2.4
github.com/go-test/deep v1.0.7
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/patrickmn/go-cache v0.0.0-20180815053127-5633e0862627
github.com/pquerna/otp v1.3.0
github.com/prometheus/client_golang v1.9.0
......
......@@ -42,8 +42,6 @@ git.autistici.org/ai3/go-common v0.0.0-20210118064555-73f00db54723 h1:ylA6azCumI
git.autistici.org/ai3/go-common v0.0.0-20210118064555-73f00db54723/go.mod h1:T8BS+630KLzy30X2lshL98H0NW3Xuyzs8NI9D6C3New=
git.autistici.org/ai3/tools/aux-db v0.0.0-20210123151036-db9b4b9a323e h1:C4zK2+nlhbP4rMRQW0kvJTZtI7docdVYHnIuI0tuvFY=
git.autistici.org/ai3/tools/aux-db v0.0.0-20210123151036-db9b4b9a323e/go.mod h1:V5UwVPYgE4w+I5dhuJp2aLbbIXmHgZsVl+yWvMBRFuQ=
git.autistici.org/ai3/tools/webappdb v0.0.0-20210117172932-02a098c04745 h1:JsOtwQw4LiTbflSkbCaPEOkg992lVJz7jALN/jtWITk=
git.autistici.org/ai3/tools/webappdb v0.0.0-20210117172932-02a098c04745/go.mod h1:vQDkLXjvjxDXG2nUcdQWOYUqGPjMCwlNVfBP+Cvg0e0=
git.autistici.org/id/auth v0.0.0-20210110171913-dd493db32815/go.mod h1:Hq4zcqE2hbrXsC9j79kzfnBf2BqlGmuVCRIz+AwX/FY=
git.autistici.org/id/auth v0.0.0-20210117173158-5b5aa9684fa2 h1:MWQyGLMcEvpqACBA5lBKncID3vESuLBKX+DOp1dX0II=
git.autistici.org/id/auth v0.0.0-20210117173158-5b5aa9684fa2/go.mod h1:uKWHbnpNKPgytrr799WCOAsiOfLsXL3G1VOrjyRYAhA=
......@@ -394,8 +392,6 @@ github.com/markbates/pkger v0.15.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQ
github.com/mattermost/xml-roundtrip-validator v0.0.0-20201213122252-bcd7e1b9601e/go.mod h1:qccnGMcpgwcNaBnxqpJpWWUiPNr5H3O8eDgGV9gT5To=
github.com/mattermost/xml-roundtrip-validator v0.0.0-20201219040909-8fd2afad43d1/go.mod h1:qccnGMcpgwcNaBnxqpJpWWUiPNr5H3O8eDgGV9gT5To=
github.com/mattes/migrate v0.0.0-20180508041624-4768a648fbd9/go.mod h1:LJcqgpj1jQoxv3m2VXd3drv0suK5CbN/RCX7MXwgnVI=
github.com/mattes/migrate v3.0.2-0.20180508041624-4768a648fbd9+incompatible h1:FAIQGZlq18kmVrnwmje0nAOsHtZaIJjJNliv4yk38rk=
github.com/mattes/migrate v3.0.2-0.20180508041624-4768a648fbd9+incompatible/go.mod h1:LJcqgpj1jQoxv3m2VXd3drv0suK5CbN/RCX7MXwgnVI=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
......
......@@ -8,7 +8,6 @@ import (
"time"
"git.autistici.org/ai3/go-common/pwhash"
"git.autistici.org/ai3/tools/webappdb/proto"
)
// Possible values for user status.
......@@ -560,6 +559,20 @@ type WebDAV struct {
Homedir string `json:"homedir"`
}
// App stores information about an application instance. The JSON
// fields should match the XML fields as used by 'freewvs --xml'.
type App struct {
//Shard string `json:"shard"`
Path string `json:"directory"`
Site string `json:"site"`
Name string `json:"appname"`
Version string `json:"version"`
SafeVersion string `json:"safeversion"`
State string `json:"state"`
VulnInfo string `json:"vulninfo"`
Timestamp time.Time `json:"timestamp"`
}
// Website resource attributes. Used for both normal websites
// (a.k.a. "subsites" of some parent domain) and domains.
type Website struct {
......@@ -574,7 +587,7 @@ type Website struct {
DocumentRoot string `json:"document_root"`
StatsID int `json:"stats_id"`
CMSInfo []*webappdb.App `json:"cms_info,omitempty"`
CMSInfo []*App `json:"cms_info,omitempty"`
}
// Database resource attributes.
......
package webappdb
import "time"
// App stores information about an application instance. The JSON
// fields should match the XML fields as used by 'freewvs --xml'.
type App struct {
Shard string `json:"shard"`
Path string `json:"directory"`
Site string `json:"site"`
Name string `json:"appname"`
Version string `json:"version"`
SafeVersion string `json:"safeversion"`
State string `json:"state"`
VulnInfo string `json:"vulninfo"`
Timestamp time.Time `json:"timestamp"`
}
// SubmissionRequest RPC.
type SubmissionRequest struct {
Shard string `json:"shard"`
Entries []*App `json:"entries"`
}
// FindAppsBySiteRequest RPC, handles multiple sites in a single
// request to minimize RPC latency.
type FindAppsBySiteRequest struct {
Sites []string `json:"sites"`
}
// FindAppsByVersionRequest RPC, handles multiple sites in a single
// request to minimize RPC latency.
type FindAppsByVersionRequest struct {
Name string `json:"name"`
Version string `json:"version"`
}
// FindAppsBySiteResponse is the response type for FindAppsBySiteRequest.
type FindAppsBySiteResponse struct {
Apps map[string][]*App `json:"apps"`
}
// FindAppsByVersionResponse is the response type for FindAppsByVersionRequest.
type FindAppsByVersionResponse struct {
Apps []*App `json:"apps"`
}
// CountAppsRequest requests various types of aggregates.
type CountAppsRequest struct {
VulnerableOnly bool `json:"vulnerable_only"`
GroupByName bool `json:"group_by_name"`
GroupByVersion bool `json:"group_by_version"`
GroupBySite bool `json:"group_by_site"`
Limit int `json:"limit"`
}
type CountResult struct {
Keys []string `json:"keys"`
Count int `json:"count"`
}
type CountAppsResponse struct {
Fields []string `json:"fields"`
Results []CountResult `json:"results"`
}
......@@ -13,9 +13,6 @@ git.autistici.org/ai3/go-common/userenckey
# git.autistici.org/ai3/tools/aux-db v0.0.0-20210123151036-db9b4b9a323e
## explicit
git.autistici.org/ai3/tools/aux-db/proto
# git.autistici.org/ai3/tools/webappdb v0.0.0-20210117172932-02a098c04745
## explicit
git.autistici.org/ai3/tools/webappdb/proto
# git.autistici.org/id/auth v0.0.0-20210117173158-5b5aa9684fa2
## explicit
git.autistici.org/id/auth
......@@ -84,6 +81,7 @@ github.com/lunixbochs/struc
# github.com/mattn/go-sqlite3 v1.14.6
github.com/mattn/go-sqlite3
# github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369
## explicit
github.com/matttproud/golang_protobuf_extensions/pbutil
# github.com/miscreant/miscreant.go v0.0.0-20200214223636-26d376326b75
github.com/miscreant/miscreant.go
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment