This repository has been archived by the owner on Sep 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MedCo v0.2.1
- Loading branch information
Showing
84 changed files
with
5,708 additions
and
680 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
package main | ||
|
||
import ( | ||
medcoclient "github.com/lca1/medco-connector/medco/client" | ||
"github.com/sirupsen/logrus" | ||
"github.com/urfave/cli" | ||
"os" | ||
"strings" | ||
) | ||
|
||
func main() { | ||
|
||
cliApp := cli.NewApp() | ||
cliApp.Name = "medco-cli-client" | ||
cliApp.Usage = "Command-line query tool for MedCo." | ||
cliApp.Version = "0.2.1" // todo: dynamically get version from build process | ||
|
||
// from env / config: whatever is in the config of GB : debug, | ||
// cli: whatever is user input | ||
|
||
// --- global app flags | ||
cliApp.Flags = []cli.Flag{ | ||
cli.StringFlag{ | ||
Name: "user, u", | ||
Usage: "OIDC user login", | ||
}, | ||
cli.StringFlag{ | ||
Name: "password, p", | ||
Usage: "OIDC password login", | ||
}, | ||
cli.StringFlag{ | ||
Name: "token, t", | ||
Usage: "OIDC token", | ||
}, | ||
cli.BoolFlag{ | ||
Name: "disableTLSCheck", | ||
Usage: "Disable check of TLS certificates", | ||
}, | ||
} | ||
|
||
// --- search command flags | ||
//searchCommandFlags := []cli.Flag{ | ||
// cli.StringFlag{ | ||
// Name: "path", | ||
// Usage: "File containing the query definition", | ||
// | ||
// }, | ||
//} | ||
|
||
//--- query command flags | ||
queryCommandFlags := []cli.Flag{ | ||
cli.StringFlag{ | ||
Name: "resultFile, r", | ||
Usage: "Output file for the result CSV. Printed to stdout if omitted.", | ||
Value: "", | ||
}, | ||
cli.BoolFlag{ | ||
Name: "bypassPicsure", | ||
Usage: "Bypass PIC-SURE and query directly the MedCo connectors", | ||
}, | ||
} | ||
|
||
// --- app commands | ||
cliApp.Commands = []cli.Command{ | ||
//{ | ||
// Name: "search", | ||
// Aliases: []string{"s"}, | ||
// Usage: "Browse the MedCo tree ontology", | ||
// Action: encryptIntFromApp, | ||
// Flags: searchCommandFlags, | ||
// ArgsUsage: "", | ||
// | ||
//}, | ||
{ | ||
Name: "query", | ||
Aliases: []string{"q"}, | ||
Usage: "Query the MedCo network", | ||
Flags: queryCommandFlags, | ||
ArgsUsage: "[patient_list|count_per_site|count_per_site_obfuscated|count_per_site_shuffled|" + | ||
"count_per_site_shuffled_obfuscated|count_global|count_global_obfuscated] [query string]", | ||
Action: func(c *cli.Context) error { | ||
return medcoclient.ExecuteClientQuery( | ||
c.GlobalString("token"), | ||
c.GlobalString("user"), | ||
c.GlobalString("password"), | ||
c.Args().First(), | ||
strings.Join(c.Args().Tail(), " "), | ||
c.String("resultFile"), | ||
c.GlobalBool("disableTLSCheck"), | ||
c.Bool("bypassPicsure"), | ||
) | ||
}, | ||
}, | ||
|
||
} | ||
|
||
//cliApp.Before = func(c *cli.Context) error { | ||
// log.SetDebugVisible(c.GlobalInt("debug")) | ||
// return nil | ||
//} | ||
err := cliApp.Run(os.Args) | ||
if err != nil { | ||
logrus.Error(err) | ||
} | ||
} |
8 changes: 4 additions & 4 deletions
8
swagger/cmd/medco-connector-server/main.go → cmd/medco-connector-server/main.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,30 @@ | ||
FROM golang:1.12.5 as build | ||
|
||
COPY ./ /src | ||
|
||
# compile and install medco-cli-client | ||
WORKDIR /src | ||
RUN CGO_ENABLED=0 go install -v ./cmd/medco-cli-client/... | ||
|
||
# ------------------------------------------- | ||
FROM golang:1.12.5-alpine as release | ||
|
||
COPY deployment/docker-entrypoint.sh /usr/local/bin/ | ||
RUN apk update && apk add bash && rm -rf /var/cache/apk/* && \ | ||
chmod a+x /usr/local/bin/docker-entrypoint.sh | ||
|
||
COPY --from=build /go/bin/medco-cli-client /go/bin/ | ||
|
||
# run-time environment | ||
ENV LOG_LEVEL=5 \ | ||
UNLYNX_GROUP_FILE_PATH=/medco-configuration/group.toml \ | ||
UNLYNX_GROUP_FILE_IDX=0 \ | ||
OIDC_CLIENT_ID=medco \ | ||
CLIENT_QUERY_TIMEOUT_SECONDS=660 \ | ||
PICSURE2_API_HOST=picsure:8080/pic-sure-api-2/PICSURE \ | ||
PICSURE2_API_BASE_PATH="" \ | ||
PICSURE2_API_SCHEME=https \ | ||
PICSURE2_RESOURCES=MEDCO_testnetwork_0_a,MEDCO_testnetwork_1_b,MEDCO_testnetwork_2_c \ | ||
OIDC_REQ_TOKEN_URL=http://keycloak:8080/auth/realms/master/protocol/openid-connect/token | ||
|
||
ENTRYPOINT ["docker-entrypoint.sh", "medco-cli-client"] |
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 |
---|---|---|
@@ -1,27 +1,32 @@ | ||
module github.com/lca1/medco-connector | ||
|
||
require ( | ||
github.com/PuerkitoBio/purell v1.1.1 // indirect | ||
github.com/go-openapi/analysis v0.18.0 // indirect | ||
github.com/go-openapi/errors v0.18.0 | ||
github.com/go-openapi/jsonpointer v0.18.0 // indirect | ||
github.com/go-openapi/jsonreference v0.18.0 // indirect | ||
github.com/go-openapi/loads v0.18.0 | ||
github.com/go-openapi/runtime v0.18.0 | ||
github.com/go-openapi/spec v0.18.0 | ||
github.com/go-openapi/strfmt v0.18.0 | ||
github.com/go-openapi/swag v0.18.0 | ||
github.com/go-openapi/validate v0.18.0 | ||
github.com/google/uuid v1.1.1 // indirect | ||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect | ||
github.com/docker/go-units v0.4.0 // indirect | ||
github.com/go-openapi/analysis v0.19.0 // indirect | ||
github.com/go-openapi/errors v0.19.0 | ||
github.com/go-openapi/jsonpointer v0.19.0 // indirect | ||
github.com/go-openapi/jsonreference v0.19.0 // indirect | ||
github.com/go-openapi/loads v0.19.0 | ||
github.com/go-openapi/runtime v0.19.0 | ||
github.com/go-openapi/spec v0.19.0 | ||
github.com/go-openapi/strfmt v0.19.0 | ||
github.com/go-openapi/swag v0.19.0 | ||
github.com/go-openapi/validate v0.19.0 | ||
github.com/jessevdk/go-flags v1.4.0 | ||
github.com/lca1/medco-unlynx v0.0.0-20190326092154-e12359adb567 | ||
github.com/lca1/unlynx v0.0.0-20190312131415-2e3533f65afe | ||
github.com/lestrrat-go/jwx v0.0.0-20190415045601-bee008e7f2ee | ||
github.com/lestrrat-go/pdebug v0.0.0-20180220043849-39f9a71bcabe // indirect | ||
github.com/mailru/easyjson v0.0.0-20190221075403-6243d8e04c3f // indirect | ||
github.com/pkg/errors v0.8.1 // indirect | ||
github.com/sirupsen/logrus v1.4.0 | ||
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a // indirect | ||
go.dedis.ch/onet/v3 v3.0.0 | ||
golang.org/x/net v0.0.0-20190311183353-d8887717615a | ||
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect | ||
github.com/lca1/medco-loader v0.2.1 | ||
github.com/lca1/medco-unlynx v0.2.1 | ||
github.com/lca1/unlynx v1.3.1 | ||
github.com/lestrrat-go/jwx v0.9.0 | ||
github.com/mailru/easyjson v0.0.0-20190403194419-1ea4449da983 // indirect | ||
github.com/pkg/errors v0.8.1 | ||
github.com/r0fls/gostats v0.0.0-20180711082619-e793b1fda35c | ||
github.com/sirupsen/logrus v1.4.2 | ||
github.com/smartystreets/assertions v1.0.0 // indirect | ||
github.com/urfave/cli v1.20.0 | ||
go.dedis.ch/onet/v3 v3.0.14 | ||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5 // indirect | ||
golang.org/x/net v0.0.0-20190606173856-1492cefac77f | ||
golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444 // indirect | ||
) |
Oops, something went wrong.