diff --git a/api/api.go b/api/api.go
index c50398a3d9d..f1965df49f4 100644
--- a/api/api.go
+++ b/api/api.go
@@ -24,6 +24,7 @@ import (
"fmt"
"net"
"net/http"
+ "strings"
"github.com/golang/protobuf/ptypes/empty"
"github.com/prometheus/client_golang/prometheus/promhttp"
@@ -38,7 +39,6 @@ import (
"google.golang.org/grpc/status"
actions_proto "www.velocidex.com/golang/velociraptor/actions/proto"
api_proto "www.velocidex.com/golang/velociraptor/api/proto"
- artifacts "www.velocidex.com/golang/velociraptor/artifacts"
artifacts_proto "www.velocidex.com/golang/velociraptor/artifacts/proto"
"www.velocidex.com/golang/velociraptor/constants"
"www.velocidex.com/golang/velociraptor/datastore"
@@ -103,10 +103,12 @@ func (self *ApiServer) LaunchFlow(
ctx context.Context,
in *flows_proto.FlowRunnerArgs) (*api_proto.StartFlowResponse, error) {
result := &api_proto.StartFlowResponse{}
- in.Creator = GetGRPCUserInfo(ctx).Name
+ creator := GetGRPCUserInfo(ctx).Name
+
+ // Internal calls from the frontend can set the creator.
+ if creator != constants.FRONTEND_NAME {
+ in.Creator = creator
- // Empty creators are called internally.
- if in.Creator != "" {
// If user is not found then reject it.
user_record, err := users.GetUser(self.config, in.Creator)
if err != nil {
@@ -491,19 +493,10 @@ func (self *ApiServer) GetArtifacts(
ctx context.Context,
in *api_proto.GetArtifactsRequest) (
*artifacts_proto.ArtifactDescriptors, error) {
- result := &artifacts_proto.ArtifactDescriptors{}
-
- repository, err := artifacts.GetGlobalRepository(self.config)
- if err != nil {
- return nil, err
- }
- for _, name := range repository.List() {
- artifact, pres := repository.Get(name)
- if pres {
- result.Items = append(result.Items, artifact)
- }
- }
- return result, nil
+ terms := strings.Split(in.SearchTerm, " ")
+ result, err := searchArtifact(
+ self.config, terms, in.Type, in.NumberOfResults)
+ return result, err
}
func (self *ApiServer) GetArtifactFile(
diff --git a/api/artifacts.go b/api/artifacts.go
index 2eea9718785..290cde291ea 100644
--- a/api/artifacts.go
+++ b/api/artifacts.go
@@ -21,6 +21,7 @@ import (
"encoding/json"
"errors"
"path"
+ "regexp"
"strings"
actions_proto "www.velocidex.com/golang/velociraptor/actions/proto"
@@ -195,3 +196,62 @@ func renderBuiltinArtifacts(
},
}, nil
}
+
+func searchArtifact(
+ config_obj *api_proto.Config,
+ terms []string,
+ artifact_type string,
+ number_of_results uint64) (
+ *artifacts_proto.ArtifactDescriptors, error) {
+
+ if number_of_results == 0 {
+ number_of_results = 100
+ }
+
+ result := &artifacts_proto.ArtifactDescriptors{}
+ regexes := []*regexp.Regexp{}
+ for _, term := range terms {
+ if len(term) <= 2 {
+ continue
+ }
+
+ re, err := regexp.Compile("(?i)" + term)
+ if err == nil {
+ regexes = append(regexes, re)
+ }
+ }
+
+ if len(regexes) == 0 {
+ return result, nil
+ }
+
+ matcher := func(text string, regexes []*regexp.Regexp) bool {
+ for _, re := range regexes {
+ if re.FindString(text) == "" {
+ return false
+ }
+ }
+ return true
+ }
+
+ repository, err := artifacts.GetGlobalRepository(config_obj)
+ if err != nil {
+ return nil, err
+ }
+
+ for _, name := range repository.List() {
+ artifact, pres := repository.Get(name)
+ if pres {
+ if matcher(artifact.Description, regexes) ||
+ matcher(artifact.Name, regexes) {
+ result.Items = append(result.Items, artifact)
+ }
+ }
+
+ if len(result.Items) >= int(number_of_results) {
+ break
+ }
+ }
+
+ return result, nil
+}
diff --git a/api/auth.go b/api/auth.go
index a889a682159..cf93f56ba15 100644
--- a/api/auth.go
+++ b/api/auth.go
@@ -22,8 +22,11 @@ import (
"encoding/json"
"net/http"
+ "google.golang.org/grpc/credentials"
"google.golang.org/grpc/metadata"
+ "google.golang.org/grpc/peer"
api_proto "www.velocidex.com/golang/velociraptor/api/proto"
+ "www.velocidex.com/golang/velociraptor/constants"
"www.velocidex.com/golang/velociraptor/logging"
users "www.velocidex.com/golang/velociraptor/users"
)
@@ -107,12 +110,26 @@ func getClientApprovalForUser(
func GetGRPCUserInfo(ctx context.Context) *api_proto.VelociraptorUser {
result := &api_proto.VelociraptorUser{}
- md, ok := metadata.FromIncomingContext(ctx)
+ peer, ok := peer.FromContext(ctx)
if ok {
- userinfo := md.Get("USER")
- if len(userinfo) > 0 {
- data := []byte(userinfo[0])
- json.Unmarshal(data, result)
+ tlsInfo, ok := peer.AuthInfo.(credentials.TLSInfo)
+ if ok {
+ v := tlsInfo.State.PeerCertificates[0].Subject.CommonName
+ // Calls from the gRPC gateway embed the
+ // authenticated web user in the metadata.
+ if v == constants.GRPC_GW_CLIENT_NAME {
+ md, ok := metadata.FromIncomingContext(ctx)
+ if ok {
+ userinfo := md.Get("USER")
+ if len(userinfo) > 0 {
+ data := []byte(userinfo[0])
+ json.Unmarshal(data, result)
+ }
+ }
+
+ } else {
+ result.Name = v
+ }
}
}
diff --git a/api/proto/artifacts.pb.go b/api/proto/artifacts.pb.go
index dabd0de5499..00dfb6f9a89 100644
--- a/api/proto/artifacts.pb.go
+++ b/api/proto/artifacts.pb.go
@@ -21,8 +21,12 @@ var _ = math.Inf
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type GetArtifactsRequest struct {
+ // Deprecated
IncludeEventArtifacts bool `protobuf:"varint,1,opt,name=include_event_artifacts,json=includeEventArtifacts,proto3" json:"include_event_artifacts,omitempty"`
IncludeServerArtifacts bool `protobuf:"varint,2,opt,name=include_server_artifacts,json=includeServerArtifacts,proto3" json:"include_server_artifacts,omitempty"`
+ SearchTerm string `protobuf:"bytes,3,opt,name=search_term,json=searchTerm,proto3" json:"search_term,omitempty"`
+ NumberOfResults uint64 `protobuf:"varint,4,opt,name=number_of_results,json=numberOfResults,proto3" json:"number_of_results,omitempty"`
+ Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@@ -32,7 +36,7 @@ func (m *GetArtifactsRequest) Reset() { *m = GetArtifactsRequest{} }
func (m *GetArtifactsRequest) String() string { return proto.CompactTextString(m) }
func (*GetArtifactsRequest) ProtoMessage() {}
func (*GetArtifactsRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_artifacts_cfe4094041344ee4, []int{0}
+ return fileDescriptor_artifacts_a25917c1f4a78cbd, []int{0}
}
func (m *GetArtifactsRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetArtifactsRequest.Unmarshal(m, b)
@@ -66,7 +70,29 @@ func (m *GetArtifactsRequest) GetIncludeServerArtifacts() bool {
return false
}
+func (m *GetArtifactsRequest) GetSearchTerm() string {
+ if m != nil {
+ return m.SearchTerm
+ }
+ return ""
+}
+
+func (m *GetArtifactsRequest) GetNumberOfResults() uint64 {
+ if m != nil {
+ return m.NumberOfResults
+ }
+ return 0
+}
+
+func (m *GetArtifactsRequest) GetType() string {
+ if m != nil {
+ return m.Type
+ }
+ return ""
+}
+
type GetArtifactRequest struct {
+ // Deprecated.
VfsPath string `protobuf:"bytes,1,opt,name=vfs_path,json=vfsPath,proto3" json:"vfs_path,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
@@ -77,7 +103,7 @@ func (m *GetArtifactRequest) Reset() { *m = GetArtifactRequest{} }
func (m *GetArtifactRequest) String() string { return proto.CompactTextString(m) }
func (*GetArtifactRequest) ProtoMessage() {}
func (*GetArtifactRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_artifacts_cfe4094041344ee4, []int{1}
+ return fileDescriptor_artifacts_a25917c1f4a78cbd, []int{1}
}
func (m *GetArtifactRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetArtifactRequest.Unmarshal(m, b)
@@ -115,7 +141,7 @@ func (m *GetArtifactResponse) Reset() { *m = GetArtifactResponse{} }
func (m *GetArtifactResponse) String() string { return proto.CompactTextString(m) }
func (*GetArtifactResponse) ProtoMessage() {}
func (*GetArtifactResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_artifacts_cfe4094041344ee4, []int{2}
+ return fileDescriptor_artifacts_a25917c1f4a78cbd, []int{2}
}
func (m *GetArtifactResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetArtifactResponse.Unmarshal(m, b)
@@ -154,7 +180,7 @@ func (m *SetArtifactRequest) Reset() { *m = SetArtifactRequest{} }
func (m *SetArtifactRequest) String() string { return proto.CompactTextString(m) }
func (*SetArtifactRequest) ProtoMessage() {}
func (*SetArtifactRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_artifacts_cfe4094041344ee4, []int{3}
+ return fileDescriptor_artifacts_a25917c1f4a78cbd, []int{3}
}
func (m *SetArtifactRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SetArtifactRequest.Unmarshal(m, b)
@@ -200,7 +226,7 @@ func (m *APIResponse) Reset() { *m = APIResponse{} }
func (m *APIResponse) String() string { return proto.CompactTextString(m) }
func (*APIResponse) ProtoMessage() {}
func (*APIResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_artifacts_cfe4094041344ee4, []int{4}
+ return fileDescriptor_artifacts_a25917c1f4a78cbd, []int{4}
}
func (m *APIResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_APIResponse.Unmarshal(m, b)
@@ -254,7 +280,7 @@ func (m *GetReportRequest) Reset() { *m = GetReportRequest{} }
func (m *GetReportRequest) String() string { return proto.CompactTextString(m) }
func (*GetReportRequest) ProtoMessage() {}
func (*GetReportRequest) Descriptor() ([]byte, []int) {
- return fileDescriptor_artifacts_cfe4094041344ee4, []int{5}
+ return fileDescriptor_artifacts_a25917c1f4a78cbd, []int{5}
}
func (m *GetReportRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetReportRequest.Unmarshal(m, b)
@@ -340,7 +366,7 @@ func (m *GetReportResponse) Reset() { *m = GetReportResponse{} }
func (m *GetReportResponse) String() string { return proto.CompactTextString(m) }
func (*GetReportResponse) ProtoMessage() {}
func (*GetReportResponse) Descriptor() ([]byte, []int) {
- return fileDescriptor_artifacts_cfe4094041344ee4, []int{6}
+ return fileDescriptor_artifacts_a25917c1f4a78cbd, []int{6}
}
func (m *GetReportResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetReportResponse.Unmarshal(m, b)
@@ -391,51 +417,54 @@ func init() {
proto.RegisterType((*GetReportResponse)(nil), "proto.GetReportResponse")
}
-func init() { proto.RegisterFile("artifacts.proto", fileDescriptor_artifacts_cfe4094041344ee4) }
-
-var fileDescriptor_artifacts_cfe4094041344ee4 = []byte{
- // 679 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x53, 0xcd, 0x6e, 0xd3, 0x4a,
- 0x14, 0x56, 0x9a, 0x36, 0x49, 0xa7, 0xb7, 0xba, 0xbd, 0x73, 0x75, 0x6f, 0x4d, 0x60, 0x71, 0x64,
- 0x24, 0x14, 0x24, 0xe4, 0xf0, 0x23, 0x41, 0x55, 0x01, 0x22, 0x51, 0x4b, 0x15, 0xd1, 0x3f, 0xdc,
- 0x0a, 0x09, 0x75, 0x11, 0x0d, 0xf6, 0x71, 0x62, 0xc9, 0x9e, 0x71, 0x66, 0x26, 0x76, 0xbb, 0x66,
- 0xc1, 0x43, 0xf0, 0x20, 0xbc, 0x00, 0x4f, 0x02, 0xaf, 0xc1, 0x02, 0x79, 0xc6, 0x31, 0xe9, 0xae,
- 0x62, 0xc1, 0x2a, 0x93, 0xf3, 0x9d, 0xef, 0x3b, 0xdf, 0xf9, 0x31, 0xf9, 0x9b, 0x49, 0x1d, 0x47,
- 0x2c, 0xd0, 0xca, 0xcb, 0xa4, 0xd0, 0x82, 0xae, 0x99, 0x9f, 0xee, 0x6e, 0x51, 0x14, 0x5e, 0x8e,
- 0x89, 0x08, 0xe2, 0x10, 0x2f, 0xbd, 0x40, 0xa4, 0xfd, 0x89, 0x48, 0x18, 0x9f, 0xf4, 0x6d, 0x50,
- 0xb2, 0x4c, 0x0b, 0xd9, 0x37, 0xc9, 0x7d, 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48, 0x71, 0xe8, 0xac, 0x99, 0xd6, 0x3b, 0x36, 0x30, 0x0a, 0xe9, 0x2d, 0xd2, 0x09,
- 0xd9, 0xd5, 0x98, 0xb3, 0x14, 0x9d, 0x96, 0xc1, 0xda, 0x21, 0xbb, 0x3a, 0x66, 0x29, 0xd2, 0x6d,
- 0xd2, 0x8e, 0x12, 0x51, 0x94, 0xac, 0xb6, 0x41, 0x5a, 0xe5, 0xdf, 0x51, 0x48, 0x67, 0x84, 0x64,
- 0x4c, 0xb2, 0x14, 0x35, 0x4a, 0xe5, 0xac, 0x42, 0xb3, 0xb7, 0xf1, 0x78, 0xd3, 0x7e, 0xd4, 0xde,
- 0xbb, 0xb7, 0x87, 0xfb, 0x3c, 0x1f, 0x0e, 0x8d, 0xab, 0xe7, 0x74, 0xd7, 0xce, 0x13, 0x7e, 0xe5,
- 0x7b, 0xe5, 0xe4, 0x14, 0x42, 0x88, 0x19, 0xf2, 0x10, 0x04, 0x37, 0x3b, 0x33, 0x03, 0x10, 0x91,
- 0x79, 0xdb, 0x99, 0x78, 0xfe, 0x52, 0x11, 0xf7, 0x63, 0x83, 0xfc, 0xb3, 0xb4, 0x9d, 0xea, 0x3c,
- 0x28, 0x59, 0x2d, 0xcf, 0xc9, 0xae, 0xc6, 0x37, 0x6f, 0xda, 0x25, 0x1d, 0x8d, 0x69, 0x96, 0x30,
- 0xbd, 0xd8, 0x73, 0xfd, 0x9f, 0xbe, 0x24, 0x9d, 0xea, 0x04, 0x94, 0xd3, 0x84, 0x66, 0x6f, 0x7d,
- 0xe8, 0x1a, 0x9f, 0x77, 0x68, 0x77, 0xdf, 0x9e, 0x93, 0x84, 0x82, 0x49, 0x5e, 0x5e, 0xd2, 0x22,
- 0xd1, 0xf3, 0x6b, 0xce, 0x87, 0x96, 0xe9, 0xf1, 0xc9, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xeb,
- 0x3c, 0x03, 0x97, 0x4d, 0x05, 0x00, 0x00,
+func init() { proto.RegisterFile("artifacts.proto", fileDescriptor_artifacts_a25917c1f4a78cbd) }
+
+var fileDescriptor_artifacts_a25917c1f4a78cbd = []byte{
+ // 734 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0xdf, 0x6e, 0xfb, 0x34,
+ 0x14, 0x56, 0xd6, 0xae, 0x7f, 0x3c, 0xa6, 0x6d, 0x46, 0xb0, 0x50, 0x90, 0xb0, 0x82, 0x84, 0x02,
+ 0x42, 0x29, 0x7f, 0x24, 0x98, 0x26, 0x40, 0xb4, 0xda, 0x98, 0x2a, 0xf6, 0x0f, 0xaf, 0x42, 0x42,
+ 0xbb, 0x88, 0xbc, 0xe4, 0xa4, 0x89, 0x94, 0xd8, 0xa9, 0xed, 0xa6, 0xdb, 0x35, 0x8f, 0xc1, 0x83,
+ 0xf0, 0x02, 0x3c, 0x09, 0xdc, 0xf0, 0x10, 0x5c, 0xa0, 0xd8, 0x69, 0xd6, 0xdd, 0x4d, 0x5c, 0xfc,
+ 0xae, 0xea, 0x9c, 0x73, 0xbe, 0xcf, 0xe7, 0x7c, 0xe7, 0x73, 0xd1, 0x01, 0x93, 0x3a, 0x4b, 0x58,
+ 0xa4, 0x55, 0x50, 0x4a, 0xa1, 0x05, 0xde, 0x35, 0x3f, 0xa3, 0xd3, 0xf5, 0x7a, 0x1d, 0x54, 0x90,
+ 0x8b, 0x28, 0x8b, 0xe1, 0x31, 0x88, 0x44, 0x31, 0x5e, 0x88, 0x9c, 0xf1, 0xc5, 0xd8, 0x06, 0x25,
+ 0x2b, 0xb5, 0x90, 0x63, 0x53, 0x3c, 0x56, 0x50, 0x30, 0xae, 0xb3, 0xc8, 0x52, 0x8c, 0xbe, 0x7b,
+ 0x1d, 0x96, 0x45, 0x3a, 0x13, 0x5c, 0x35, 0x1c, 0xd5, 0x32, 0xb7, 0x70, 0xef, 0x1f, 0x07, 0xbd,
+ 0x7d, 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0xfa, 0xfc, 0x00, 0x8f, 0xce, 0xad, 0x9d,
+ 0x24, 0x59, 0x33, 0xc9, 0x6b, 0x27, 0x6d, 0x0a, 0x03, 0xda, 0x62, 0x1e, 0x7a, 0x66, 0xc6, 0xaf,
+ 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x9b, 0xc2, 0x4e, 0x98, 0xae, 0x05, 0x00, 0x00,
}
diff --git a/api/proto/artifacts.proto b/api/proto/artifacts.proto
index 13c85b27bde..d557c8a2bda 100644
--- a/api/proto/artifacts.proto
+++ b/api/proto/artifacts.proto
@@ -7,12 +7,18 @@ import "www.velocidex.com/golang/velociraptor/actions/proto/vql.proto";
package proto;
message GetArtifactsRequest {
+ // Deprecated
bool include_event_artifacts = 1;
bool include_server_artifacts = 2;
+
+ string search_term = 3;
+ uint64 number_of_results = 4;
+ string type = 5;
}
message GetArtifactRequest {
+ // Deprecated.
string vfs_path = 1 [(sem_type) = {
description: "The vfs path relative to the artifacts definition store."
}];
diff --git a/api/proxy.go b/api/proxy.go
index 26f8d197be4..5ad27b0e248 100644
--- a/api/proxy.go
+++ b/api/proxy.go
@@ -34,10 +34,17 @@ import (
"google.golang.org/grpc/metadata"
api_proto "www.velocidex.com/golang/velociraptor/api/proto"
"www.velocidex.com/golang/velociraptor/constants"
+ "www.velocidex.com/golang/velociraptor/crypto"
"www.velocidex.com/golang/velociraptor/grpc_client"
"www.velocidex.com/golang/velociraptor/logging"
)
+var (
+ // An internal cert used to make grpc calles from the gw proxy
+ // to the grpc service.
+ api_handle_certificate *crypto.CertBundle
+)
+
func AddProxyMux(config_obj *api_proto.Config, mux *http.ServeMux) error {
logger := logging.Manager.GetLogger(config_obj, &logging.GUIComponent)
@@ -225,11 +232,23 @@ func GetAPIHandler(
}),
)
+ // Generate internal certificates so we can tell when a call
+ // came from internal.
+ if api_handle_certificate == nil {
+ new_cert, err := crypto.GenerateServerCert(
+ config_obj, constants.GRPC_GW_CLIENT_NAME)
+ if err != nil {
+ return nil, err
+ }
+
+ api_handle_certificate = new_cert
+ }
+
// We use the Frontend's certificate because this connection
// represents an internal connection.
cert, err := tls.X509KeyPair(
- []byte(config_obj.Frontend.Certificate),
- []byte(config_obj.Frontend.PrivateKey))
+ []byte(api_handle_certificate.Cert),
+ []byte(api_handle_certificate.PrivateKey))
if err != nil {
return nil, err
}
diff --git a/constants/constants.go b/constants/constants.go
index 6435e41fa32..2f830efb587 100644
--- a/constants/constants.go
+++ b/constants/constants.go
@@ -50,7 +50,8 @@ const (
// Messages to the client which we dont care about their responses.
IgnoreResponseState = uint64(101)
- FRONTEND_NAME = "VelociraptorServer"
+ FRONTEND_NAME = "VelociraptorServer"
+ GRPC_GW_CLIENT_NAME = "GRPC_GW"
ServerMonitoringFlowURN = "aff4:/config/server_monitoring.json"
)
diff --git a/glob/glob.go b/glob/glob.go
index d4ed05455a1..afa7960e13d 100644
--- a/glob/glob.go
+++ b/glob/glob.go
@@ -324,6 +324,7 @@ func (self Globber) ExpandWithContext(
if !ok {
break search_subdir
}
+
output_chan <- f
}
}
diff --git a/gui/static/angular-components/artifact/artifact.js b/gui/static/angular-components/artifact/artifact.js
index a0c0ced4fab..8ae8eaf71e9 100644
--- a/gui/static/angular-components/artifact/artifact.js
+++ b/gui/static/angular-components/artifact/artifact.js
@@ -11,6 +11,7 @@ const {ArtifactsParamsFormDirective} = goog.require('grrUi.artifact.artifactsPar
const {LineChartDirective} = goog.require('grrUi.artifact.lineChartDirective');
const {TimelineDirective} = goog.require('grrUi.artifact.timelineDirective');
const {ReportingDirective} = goog.require('grrUi.artifact.reportingDirective');
+const {SearchArtifactDirective} = goog.require('grrUi.artifact.searchArtifactDirective');
const {SyntaxHighlightDirective} = goog.require('grrUi.artifact.syntaxHighlightDirective');
const {coreModule} = goog.require('grrUi.core.core');
const {formsModule} = goog.require('grrUi.forms.forms');
@@ -39,6 +40,9 @@ exports.artifactModule.directive(
exports.artifactModule.directive(
ReportingDirective.directive_name, ReportingDirective);
+exports.artifactModule.directive(
+ SearchArtifactDirective.directive_name,
+ SearchArtifactDirective);
exports.artifactModule.directive(
SyntaxHighlightDirective.directive_name,
SyntaxHighlightDirective);
diff --git a/gui/static/angular-components/artifact/artifacts-parameters-form-directive.js b/gui/static/angular-components/artifact/artifacts-parameters-form-directive.js
index 23a5e99e713..ab94a44364e 100644
--- a/gui/static/angular-components/artifact/artifacts-parameters-form-directive.js
+++ b/gui/static/angular-components/artifact/artifacts-parameters-form-directive.js
@@ -15,28 +15,21 @@ goog.module.declareLegacyNamespace();
const ArtifactsParamsFormController = function($scope, $rootScope) {
/** @private {!angular.Scope} */
this.scope_ = $scope;
-
- /** @private {!angular.Scope} */
- this.rootScope_ = $rootScope;
};
ArtifactsParamsFormController.prototype.addItem = function() {
- var descriptor = this.rootScope_["selectedArtifact"];
- if (angular.isUndefined(this.scope_.value.env)) {
- this.scope_.value.env = []
- }
-
- if (angular.isDefined(descriptor)) {
- for (var i=0; i
Flow arguments:
-