From a340848766a4af4335a635c8e8c988fdefc5e469 Mon Sep 17 00:00:00 2001 From: Andrew Weiss Date: Fri, 11 Jan 2019 14:14:57 -0500 Subject: [PATCH] rename imports and cleanup goreleaser config --- .circleci/config.yml | 4 ++-- .dockerignore | 3 +++ .gitignore | 2 ++ .goreleaser.yml | 21 ++++++--------------- Dockerfile | 8 ++++---- Dockerfile.build | 12 ++++++------ Dockerfile.generate | 2 +- Makefile | 16 +++++++++------- README.md | 18 +++++++++--------- cli/cmd/cmd.go | 4 ++-- cli/cmd/convert/oscal.go | 2 +- cli/cmd/generate.go | 6 +++--- cli/cmd/implementation.go | 9 +++------ cli/cmd/validate.go | 2 +- cli/main.go | 2 +- docs/config.toml | 2 +- docs/content/docs/quick-start.md | 6 +++--- docs/layouts/index.html | 4 ++-- generator/generator_test.go | 5 ++--- generator/mapper.go | 5 ++--- generator/reader.go | 7 +++---- impl/impl_test.go | 4 ++-- impl/implementation.go | 4 ++-- metaschema/generate.go | 2 +- metaschema/template.go | 4 ++-- templates/catalog.go | 2 +- templates/implementation.go | 2 +- templates/profile.go | 4 ++-- test/TestCases.go | 2 +- test/main.go | 2 +- test/methods.go | 6 +++--- types/oscal/oscal.go | 26 +++++++++++++------------- types/oscal/profile/profile.go | 2 +- 33 files changed, 96 insertions(+), 104 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0db55ccc..14178ffb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ jobs: test: docker: - image: circleci/golang:1.11 - working_directory: /go/src/github.com/opencontrol/oscalkit + working_directory: /go/src/github.com/docker/oscalkit environment: TEST_RESULTS: /tmp/test-results steps: @@ -36,7 +36,7 @@ jobs: deploy: docker: - image: circleci/golang:1.11 - working_directory: /go/src/github.com/opencontrol/oscalkit + working_directory: /go/src/github.com/docker/oscalkit steps: - setup_remote_docker: docker_layer_caching: true diff --git a/.dockerignore b/.dockerignore index 980f03a2..8b54d95f 100644 --- a/.dockerignore +++ b/.dockerignore @@ -12,3 +12,6 @@ Makefile oscalkit README.md sample/ +oscalkit_* +docs/ +LICENSE.md \ No newline at end of file diff --git a/.gitignore b/.gitignore index e5e035fc..56a09f53 100644 --- a/.gitignore +++ b/.gitignore @@ -5,9 +5,11 @@ *.dll *.so *.dylib +oscalkit_* # Test binary, build with `go test -c` *.test +coverage.txt # Output of the go coverage tool, specifically when used with LiteIDE *.out diff --git a/.goreleaser.yml b/.goreleaser.yml index dcde5167..d550271a 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,7 +1,7 @@ builds: - binary: oscalkit main: ./cli/main.go - ldflags: -s -w -X github.com/opencontrol/oscalkit/cli/version.Version={{.Version}} -X github.com/opencontrol/oscalkit/cli/version.Build={{.ShortCommit}} -X github.com/opencontrol/oscalkit/cli/version.Date={{.Date}} + ldflags: -s -w -X github.com/docker/oscalkit/cli/version.Version={{.Version}} -X github.com/docker/oscalkit/cli/version.Build={{.ShortCommit}} -X github.com/docker/oscalkit/cli/version.Date={{.Date}} env: - CGO_ENABLED=0 goos: @@ -11,17 +11,8 @@ builds: goarch: - amd64 -nfpm: - homepage: https://github.com/opencontrol/oscalkit - license: CC0 1.0 - dependencies: - - libxml2-utils - formats: - - deb - - rpm - dockers: - - image: opencontrolorg/oscalkit + - image: docker/oscalkit dockerfile: Dockerfile.release tag_templates: - "{{ .Version }}" @@ -30,11 +21,11 @@ dockers: brew: name: oscalkit github: - owner: opencontrol + owner: docker name: homebrew-oscalkit commit_author: - name: OpenControl - email: dev@open-control.org - homepage: https://github.com/opencontrol/oscalkit + name: Andrew Weiss + email: anweiss@docker.com + homepage: https://github.com/docker/oscalkit dependencies: - libxml2 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index a3e06772..e2832dee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,17 +9,17 @@ # If not, see . FROM golang:1.11-alpine AS builder -WORKDIR /go/src/github.com/opencontrol/oscalkit +WORKDIR /go/src/github.com/docker/oscalkit ARG VERSION ARG BUILD ARG DATE COPY . . -WORKDIR /go/src/github.com/opencontrol/oscalkit/cli -RUN CGO_ENABLED=0 go build -o oscalkit -v -ldflags "-s -w -X github.com/opencontrol/oscalkit/cli/version.Version=${VERSION} -X github.com/opencontrol/oscalkit/cli/version.Build=${BUILD} -X github.com/opencontrol/oscalkit/cli/version.Date=${DATE}" +WORKDIR /go/src/github.com/docker/oscalkit/cli +RUN CGO_ENABLED=0 go build -o oscalkit -v -ldflags "-s -w -X github.com/docker/oscalkit/cli/version.Version=${VERSION} -X github.com/docker/oscalkit/cli/version.Build=${BUILD} -X github.com/docker/oscalkit/cli/version.Date=${DATE}" FROM alpine:3.7 RUN apk --no-cache add ca-certificates libxml2-utils WORKDIR /oscalkit -COPY --from=builder /go/src/github.com/opencontrol/oscalkit/cli/oscalkit /oscalkit-linux-x86_64 +COPY --from=builder /go/src/github.com/docker/oscalkit/cli/oscalkit /oscalkit-linux-x86_64 RUN ln -s /oscalkit-linux-x86_64 /usr/local/bin/oscalkit ENTRYPOINT ["oscalkit"] diff --git a/Dockerfile.build b/Dockerfile.build index 20d86bb8..ac1a7fa0 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -9,9 +9,9 @@ # If not, see . FROM golang:1.11 AS race-detector -WORKDIR /go/src/github.com/opencontrol/oscalkit +WORKDIR /go/src/github.com/docker/oscalkit COPY . . -WORKDIR /go/src/github.com/opencontrol/oscalkit/cli +WORKDIR /go/src/github.com/docker/oscalkit/cli RUN go build -race FROM golang:1.11 @@ -21,7 +21,7 @@ ARG VERSION ARG BUILD ARG DATE ARG BINARY -WORKDIR /go/src/github.com/opencontrol/oscalkit -COPY --from=race-detector /go/src/github.com/opencontrol/oscalkit . -WORKDIR /go/src/github.com/opencontrol/oscalkit/cli -RUN CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -o /${BINARY} -v -ldflags "-s -w -X github.com/opencontrol/oscalkit/cli/version.Version=${VERSION} -X github.com/opencontrol/oscalkit/cli/version.Build=${BUILD} -X github.com/opencontrol/oscalkit/cli/version.Date=${DATE}" +WORKDIR /go/src/github.com/docker/oscalkit +COPY --from=race-detector /go/src/github.com/docker/oscalkit . +WORKDIR /go/src/github.com/docker/oscalkit/cli +RUN CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -o /${BINARY} -v -ldflags "-s -w -X github.com/docker/oscalkit/cli/version.Version=${VERSION} -X github.com/docker/oscalkit/cli/version.Build=${BUILD} -X github.com/docker/oscalkit/cli/version.Date=${DATE}" diff --git a/Dockerfile.generate b/Dockerfile.generate index c206fe83..ee3458c2 100644 --- a/Dockerfile.generate +++ b/Dockerfile.generate @@ -1,3 +1,3 @@ FROM golang:1.11-alpine RUN apk add --no-cache git -WORKDIR /go/src/github.com/opencontrol/oscalkit/metaschema +WORKDIR /go/src/github.com/docker/oscalkit/metaschema diff --git a/Makefile b/Makefile index 13d5eb20..ae9b5768 100644 --- a/Makefile +++ b/Makefile @@ -14,17 +14,17 @@ VERSION := 0.2.0 BUILD := $(shell git rev-parse --short HEAD)-dev DATE := $(shell date "+%Y-%m-%d") -NAMESPACE := opencontrolorg +NAMESPACE := docker REPO := oscalkit BINARY=oscalkit_$(GOOS)_$(GOARCH) .DEFAULT_GOAL := $(BINARY) -.PHONY: test build-docker push $(BINARY) clean +.PHONY: test build-docker push $(BINARY) clean generate generate: docker build -t $(NAMESPACE)/$(REPO):generate -f Dockerfile.generate . docker container run \ - -v $$PWD:/go/src/github.com/opencontrol/oscalkit \ + -v $$PWD:/go/src/github.com/docker/oscalkit \ $(NAMESPACE)/$(REPO):generate \ sh -c "go generate" @@ -37,9 +37,7 @@ build-docker: push: build-docker docker image push $(NAMESPACE)/$(REPO):$(BUILD) -# Builds binary for the OS/arch. Assumes that types have already been generated -# via the "generate" target -$(BINARY): +build: docker image build -f Dockerfile.build \ --build-arg GOOS=$(GOOS) \ --build-arg GOARCH=$(GOARCH) \ @@ -47,7 +45,11 @@ $(BINARY): --build-arg BUILD=$(BUILD) \ --build-arg DATE=$(DATE) \ --build-arg BINARY=$(BINARY) \ - -t $(NAMESPACE)/$(REPO):$(VERSION)-$(BUILD)-builder .; + -t $(NAMESPACE)/$(REPO):$(VERSION)-$(BUILD)-builder . + +# Builds binary for the OS/arch. Assumes that types have already been generated +# via the "generate" target +$(BINARY): build $(eval ID := $(shell docker create $(NAMESPACE)/$(REPO):$(VERSION)-$(BUILD)-builder)) @docker cp $(ID):/$(BINARY) . @docker rm $(ID) >/dev/null diff --git a/README.md b/README.md index 3c0a75d4..fd151cb0 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # oscalkit -[![CircleCI](https://circleci.com/gh/opencontrol/oscalkit.svg?style=svg)](https://circleci.com/gh/opencontrol/oscalkit) [![codecov](https://codecov.io/gh/opencontrol/oscalkit/branch/master/graph/badge.svg)](https://codecov.io/gh/opencontrol/oscalkit) [![GoDoc](https://godoc.org/github.com/opencontrol/oscalkit?status.svg)](https://godoc.org/github.com/opencontrol/oscalkit) +[![CircleCI](https://circleci.com/gh/docker/oscalkit.svg?style=svg)](https://circleci.com/gh/docker/oscalkit) [![codecov](https://codecov.io/gh/docker/oscalkit/branch/master/graph/badge.svg)](https://codecov.io/gh/docker/oscalkit) [![GoDoc](https://godoc.org/github.com/docker/oscalkit?status.svg)](https://godoc.org/github.com/docker/oscalkit) -> In development. Since the OSCAL schemas are still under active development, parsing errors may occur if running the tool against OSCAL documents that are developed against iterations of the schemas that aren't supported. Individual [Releases](https://github.com/opencontrol/oscalkit/releases) of `oscalkit` will indicate in the notes which commits in the usnistgov/OSCAL repo against which the tool has been tested. +> In development. Since the OSCAL schemas are still under active development, parsing errors may occur if running the tool against OSCAL documents that are developed against iterations of the schemas that aren't supported. Individual [Releases](https://github.com/docker/oscalkit/releases) of `oscalkit` will indicate in the notes which commits in the usnistgov/OSCAL repo against which the tool has been tested. -Barebones Go SDK and CLI tool for parsing OSCAL, converting between OSCAL-formatted XML, JSON and YAML and for converting from [OpenControl](http://opencontrol.cfapps.io/) projects in to OSCAL. +Barebones Go SDK and CLI tool for parsing OSCAL, converting between OSCAL-formatted XML, JSON and YAML and for converting from [docker](http://opencontrol.cfapps.io/) projects in to OSCAL. ## Supported OSCAL Components @@ -18,23 +18,23 @@ The following OSCAL components are currently supported: ## Installing -You can download the appropriate `oscalkit` command-line utility for your system from the [GitHub Releases](https://github.com/opencontrol/oscalkit/releases) page and run it from your local machine directly. For easier execution, you can move it to an appropriate directory listed in your `$PATH` environment variable. If you prefer, you can download and install via the included RPM/Deb packages on Linux or Homebrew recipe on macOS. A [Docker image](https://hub.docker.com/r/opencontrolorg/oscalkit/) is also made available on Docker Hub. +You can download the appropriate `oscalkit` command-line utility for your system from the [GitHub Releases](https://github.com/docker/oscalkit/releases) page and run it from your local machine directly. For easier execution, you can move it to an appropriate directory listed in your `$PATH` environment variable. If you prefer, you can download and install via the included RPM/Deb packages on Linux or Homebrew recipe on macOS. A [Docker image](https://hub.docker.com/r/docker/oscalkit/) is also made available on Docker Hub. ### Homebrew - $ brew tap opencontrol/homebrew-oscalkit + $ brew tap docker/homebrew-oscalkit $ brew install oscalkit ### Docker > Running the `oscalkit` Docker container requires either bind-mounting the directory containing your source files or passing file contents in to the command via stdin. - $ docker pull opencontrolorg/oscalkit: - $ docker run -it --rm -v $PWD:/data -w /data opencontrolorg/oscalkit convert oscal-core.xml + $ docker pull docker/oscalkit: + $ docker run -it --rm -v $PWD:/data -w /data docker/oscalkit convert oscal-core.xml via stdin: - $ docker run -it --rm opencontrolorg/oscalkit convert < oscal-core.xml + $ docker run -it --rm docker/oscalkit convert < oscal-core.xml ## Usage @@ -135,7 +135,7 @@ USAGE: oscalkit convert opencontrol [command options] [opencontrol.yaml-filepath] [opencontrols-dir-path] DESCRIPTION: - Convert OpenControl-formatted "component" and "opencontrol" YAML into + Convert OpenControl-formatted "component" and "OpenControl" YAML into OSCAL-formatted "implementation" layer JSON OPTIONS: diff --git a/cli/cmd/cmd.go b/cli/cmd/cmd.go index cd0e5e60..2ee0c60d 100644 --- a/cli/cmd/cmd.go +++ b/cli/cmd/cmd.go @@ -15,8 +15,8 @@ import ( "os" "github.com/Sirupsen/logrus" - "github.com/opencontrol/oscalkit/cli/cmd/convert" - "github.com/opencontrol/oscalkit/cli/version" + "github.com/docker/oscalkit/cli/cmd/convert" + "github.com/docker/oscalkit/cli/version" "github.com/urfave/cli" ) diff --git a/cli/cmd/convert/oscal.go b/cli/cmd/convert/oscal.go index afcae59d..6425ea7d 100644 --- a/cli/cmd/convert/oscal.go +++ b/cli/cmd/convert/oscal.go @@ -23,7 +23,7 @@ import ( "strings" "github.com/Sirupsen/logrus" - "github.com/opencontrol/oscalkit/types/oscal" + "github.com/docker/oscalkit/types/oscal" "github.com/urfave/cli" ) diff --git a/cli/cmd/generate.go b/cli/cmd/generate.go index 1c6d0af1..7bf7963f 100644 --- a/cli/cmd/generate.go +++ b/cli/cmd/generate.go @@ -7,9 +7,9 @@ import ( "os" "github.com/Sirupsen/logrus" - "github.com/opencontrol/oscalkit/generator" - "github.com/opencontrol/oscalkit/templates" - "github.com/opencontrol/oscalkit/types/oscal/catalog" + "github.com/docker/oscalkit/generator" + "github.com/docker/oscalkit/templates" + "github.com/docker/oscalkit/types/oscal/catalog" "github.com/urfave/cli" ) diff --git a/cli/cmd/implementation.go b/cli/cmd/implementation.go index aca280c4..b236fe24 100644 --- a/cli/cmd/implementation.go +++ b/cli/cmd/implementation.go @@ -11,12 +11,9 @@ import ( "os" "github.com/Sirupsen/logrus" - - "github.com/opencontrol/oscalkit/templates" - - "github.com/opencontrol/oscalkit/impl" - - "github.com/opencontrol/oscalkit/generator" + "github.com/docker/oscalkit/generator" + "github.com/docker/oscalkit/impl" + "github.com/docker/oscalkit/templates" "github.com/urfave/cli" ) diff --git a/cli/cmd/validate.go b/cli/cmd/validate.go index b684b4af..e9003228 100644 --- a/cli/cmd/validate.go +++ b/cli/cmd/validate.go @@ -14,7 +14,7 @@ import ( "path/filepath" "github.com/Sirupsen/logrus" - "github.com/opencontrol/oscalkit/validator" + "github.com/docker/oscalkit/validator" "github.com/urfave/cli" ) diff --git a/cli/main.go b/cli/main.go index cecf9213..57d43a1b 100644 --- a/cli/main.go +++ b/cli/main.go @@ -11,7 +11,7 @@ package main import ( - "github.com/opencontrol/oscalkit/cli/cmd" + "github.com/docker/oscalkit/cli/cmd" ) func main() { diff --git a/docs/config.toml b/docs/config.toml index 51bb567a..d0bf6a63 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -1,4 +1,4 @@ -baseURL = "https://opencontrol.github.io/oscalkit/" +baseURL = "https://docker.github.io/oscalkit/" languageCode = "en-us" title = "oscalkit" theme = "oscalkit" diff --git a/docs/content/docs/quick-start.md b/docs/content/docs/quick-start.md index 73cd8bfd..eae8b993 100644 --- a/docs/content/docs/quick-start.md +++ b/docs/content/docs/quick-start.md @@ -9,7 +9,7 @@ bref = "Install oscalkit and become familiar with the basic functionality it pro

Install

-oscalkit has been packaged for various OS's and as a Docker image. Navigate to the [Releases](https://github.com/opencontrol/oscalkit/releases) page to download the appropriate package for your intended platform. +oscalkit has been packaged for various OS's and as a Docker image. Navigate to the [Releases](https://github.com/docker/oscalkit/releases) page to download the appropriate package for your intended platform. #### macOS (Homebrew) @@ -21,11 +21,11 @@ to update: #### Windows -Download the .exe from the [Releases](https://github.com/opencontrol/oscalkit/releases) page. Move it to a location from which it can be easily executed. +Download the .exe from the [Releases](https://github.com/docker/oscalkit/releases) page. Move it to a location from which it can be easily executed. #### Linux -Download the binary from the [Releases](https://github.com/opencontrol/oscalkit/releases) page. Move it to a location from which it can be easily executed. +Download the binary from the [Releases](https://github.com/docker/oscalkit/releases) page. Move it to a location from which it can be easily executed. #### Verify installation diff --git a/docs/layouts/index.html b/docs/layouts/index.html index 255e8e33..22fc26fd 100644 --- a/docs/layouts/index.html +++ b/docs/layouts/index.html @@ -8,12 +8,12 @@

{{.Title}}

{{.Description}}

- Download View on Github OSCAL on Github + Download View on Github OSCAL on Github

Download binaries for various platforms

macOS brew install oscalkit
- {{/* oscalkit from imperavi is an awesome CSS & JS Framework and i designed this template for hugo with the same original philosophy ! */}} + {{/* oscalkit from imperavi is an awesome CSS & JS Framework and i designed this template for hugo with the same original philosophy ! */}}
{{/*
diff --git a/generator/generator_test.go b/generator/generator_test.go index 9fab9630..c903045f 100644 --- a/generator/generator_test.go +++ b/generator/generator_test.go @@ -6,9 +6,8 @@ import ( "net/url" "testing" - "github.com/opencontrol/oscalkit/types/oscal/profile" - - "github.com/opencontrol/oscalkit/types/oscal/catalog" + "github.com/docker/oscalkit/types/oscal/catalog" + "github.com/docker/oscalkit/types/oscal/profile" ) const ( diff --git a/generator/mapper.go b/generator/mapper.go index 3428fe5e..060fd626 100644 --- a/generator/mapper.go +++ b/generator/mapper.go @@ -5,9 +5,8 @@ import ( "strings" "github.com/Sirupsen/logrus" - - "github.com/opencontrol/oscalkit/types/oscal/catalog" - "github.com/opencontrol/oscalkit/types/oscal/profile" + "github.com/docker/oscalkit/types/oscal/catalog" + "github.com/docker/oscalkit/types/oscal/profile" ) //CreateCatalogsFromProfile maps profile controls to multiple catalogs diff --git a/generator/reader.go b/generator/reader.go index 6b1dc0e0..0d8a9ef1 100644 --- a/generator/reader.go +++ b/generator/reader.go @@ -11,10 +11,9 @@ import ( "strings" "time" - "github.com/opencontrol/oscalkit/types/oscal/profile" - - "github.com/opencontrol/oscalkit/types/oscal" - "github.com/opencontrol/oscalkit/types/oscal/catalog" + "github.com/docker/oscalkit/types/oscal" + "github.com/docker/oscalkit/types/oscal/catalog" + "github.com/docker/oscalkit/types/oscal/profile" ) //ReadCatalog ReadCatalog diff --git a/impl/impl_test.go b/impl/impl_test.go index a65ec1b4..6f1fa611 100644 --- a/impl/impl_test.go +++ b/impl/impl_test.go @@ -5,8 +5,8 @@ import ( "net/url" "testing" - "github.com/opencontrol/oscalkit/types/oscal/catalog" - "github.com/opencontrol/oscalkit/types/oscal/profile" + "github.com/docker/oscalkit/types/oscal/catalog" + "github.com/docker/oscalkit/types/oscal/profile" ) const ( diff --git a/impl/implementation.go b/impl/implementation.go index 795e3ac8..8765b03f 100644 --- a/impl/implementation.go +++ b/impl/implementation.go @@ -4,8 +4,8 @@ import ( "regexp" "strings" - "github.com/opencontrol/oscalkit/types/oscal/implementation" - "github.com/opencontrol/oscalkit/types/oscal/profile" + "github.com/docker/oscalkit/types/oscal/implementation" + "github.com/docker/oscalkit/types/oscal/profile" uuid "github.com/satori/go.uuid" ) diff --git a/metaschema/generate.go b/metaschema/generate.go index 75038a2f..883aa602 100644 --- a/metaschema/generate.go +++ b/metaschema/generate.go @@ -10,7 +10,7 @@ import ( "os" "os/exec" - "github.com/opencontrol/oscalkit/metaschema" + "github.com/docker/oscalkit/metaschema" ) const ( diff --git a/metaschema/template.go b/metaschema/template.go index 878a4a55..71b589ff 100644 --- a/metaschema/template.go +++ b/metaschema/template.go @@ -9,7 +9,7 @@ import ( "text/template" "github.com/iancoleman/strcase" - "github.com/mitchellh/go-wordwrap" + wordwrap "github.com/mitchellh/go-wordwrap" ) const ( @@ -129,7 +129,7 @@ func getImports(metaschema Metaschema) string { imports.WriteString("\t\"encoding/xml\"\n") if im := metaschema.ImportedMetaschema; im != nil { - imports.WriteString(fmt.Sprintf("\n\t\"github.com/opencontrol/oscalkit/types/oscal/%s\"\n", strings.ToLower(im.Use))) + imports.WriteString(fmt.Sprintf("\n\t\"github.com/docker/oscalkit/types/oscal/%s\"\n", strings.ToLower(im.Use))) } imports.WriteString(")") diff --git a/templates/catalog.go b/templates/catalog.go index 03e2da1b..1e48dd00 100644 --- a/templates/catalog.go +++ b/templates/catalog.go @@ -12,7 +12,7 @@ const catalogtTemplate = ` package oscalkit import ( - "github.com/opencontrol/oscalkit/types/oscal/catalog" + "github.com/docker/oscalkit/types/oscal/catalog" ) var ApplicableControls = []catalog.Catalog{ diff --git a/templates/implementation.go b/templates/implementation.go index a9de9f5b..2f0eba84 100644 --- a/templates/implementation.go +++ b/templates/implementation.go @@ -10,7 +10,7 @@ func GetImplementationTemplate() (*template.Template, error) { const implementationTemplate = `package oscalkit import ( - "github.com/opencontrol/oscalkit/types/oscal/implementation" + "github.com/docker/oscalkit/types/oscal/implementation" ) var ImplementationGenerated = implementation.Implementation{ diff --git a/templates/profile.go b/templates/profile.go index 707a53e7..a6de7a8f 100644 --- a/templates/profile.go +++ b/templates/profile.go @@ -16,8 +16,8 @@ package oscalkit import ( "net/url" - "github.com/opencontrol/oscalkit/types/oscal/catalog" - "github.com/opencontrol/oscalkit/types/oscal/profile" + "github.com/docker/oscalkit/types/oscal/catalog" + "github.com/docker/oscalkit/types/oscal/profile" ) diff --git a/test/TestCases.go b/test/TestCases.go index 2a7d742f..5d73c8e7 100644 --- a/test/TestCases.go +++ b/test/TestCases.go @@ -5,8 +5,8 @@ import ( "os" "path/filepath" + "github.com/docker/oscalkit/types/oscal/catalog" "github.com/fatih/color" - "github.com/opencontrol/oscalkit/types/oscal/catalog" ) // SecurityControlsSubcontrolCheck is a test to verify that all controls from the catalog are being mapped correctly diff --git a/test/main.go b/test/main.go index 5d6234ec..c645879b 100644 --- a/test/main.go +++ b/test/main.go @@ -5,7 +5,7 @@ import ( "os" "path/filepath" - "github.com/opencontrol/oscalkit" + "github.com/docker/oscalkit" ) func main() { diff --git a/test/methods.go b/test/methods.go index fa7bd29a..f62ed6f0 100644 --- a/test/methods.go +++ b/test/methods.go @@ -10,9 +10,9 @@ import ( "reflect" "strings" - "github.com/opencontrol/oscalkit/types/oscal" - "github.com/opencontrol/oscalkit/types/oscal/catalog" - "github.com/opencontrol/oscalkit/types/oscal/profile" + "github.com/docker/oscalkit/types/oscal" + "github.com/docker/oscalkit/types/oscal/catalog" + "github.com/docker/oscalkit/types/oscal/profile" ) // StructExaminer To Verify The Structure diff --git a/types/oscal/oscal.go b/types/oscal/oscal.go index 18fa2b01..16583291 100644 --- a/types/oscal/oscal.go +++ b/types/oscal/oscal.go @@ -18,8 +18,8 @@ import ( "io" "io/ioutil" - "github.com/opencontrol/oscalkit/types/oscal/catalog" - "github.com/opencontrol/oscalkit/types/oscal/profile" + "github.com/docker/oscalkit/types/oscal/catalog" + "github.com/docker/oscalkit/types/oscal/profile" yaml "gopkg.in/yaml.v2" ) @@ -53,15 +53,15 @@ type Options struct { Reader io.Reader } -// OpenControlOptions ... -type OpenControlOptions struct { - OpenControlYAMLFilepath string - OpenControlsDir string +// dockerOptions ... +type dockerOptions struct { + dockerYAMLFilepath string + dockersDir string } -// NewFromOC initializes an OSCAL type from raw OpenControl data -// func NewFromOC(options OpenControlOptions) (*OSCAL, error) { -// ocFile, err := os.Open(options.OpenControlYAMLFilepath) +// NewFromOC initializes an OSCAL type from raw docker data +// func NewFromOC(options dockerOptions) (*OSCAL, error) { +// ocFile, err := os.Open(options.dockerYAMLFilepath) // if err != nil { // return nil, err // } @@ -72,13 +72,13 @@ type OpenControlOptions struct { // return nil, err // } -// var oc opencontrol.OpenControl +// var oc docker.docker // if err := yaml.Unmarshal(rawOC, &oc); err != nil { // return nil, err // } // ocComponentFileList := []string{} -// filepath.Walk(filepath.Join(options.OpenControlsDir, "components/"), func(path string, f os.FileInfo, err error) error { +// filepath.Walk(filepath.Join(options.dockersDir, "components/"), func(path string, f os.FileInfo, err error) error { // if !f.IsDir() && (filepath.Ext(path) == ".yaml" || filepath.Ext(path) == ".yml") { // absPath, err := filepath.Abs(path) // if err != nil { @@ -90,7 +90,7 @@ type OpenControlOptions struct { // return nil // }) -// ocComponents := []opencontrol.Component{} +// ocComponents := []docker.Component{} // for _, ocComponentFilepath := range ocComponentFileList { // ocComponentFile, err := os.Open(ocComponentFilepath) // if err != nil { @@ -100,7 +100,7 @@ type OpenControlOptions struct { // rawOCComponentFile, err := ioutil.ReadAll(ocComponentFile) -// var ocComponent opencontrol.Component +// var ocComponent docker.Component // if err := yaml.Unmarshal(rawOCComponentFile, &ocComponent); err != nil { // return nil, err // } diff --git a/types/oscal/profile/profile.go b/types/oscal/profile/profile.go index 57a0b5cf..ba6f8bc7 100644 --- a/types/oscal/profile/profile.go +++ b/types/oscal/profile/profile.go @@ -3,7 +3,7 @@ package profile import ( "encoding/xml" - "github.com/opencontrol/oscalkit/types/oscal/catalog" + "github.com/docker/oscalkit/types/oscal/catalog" ) // Each OSCAL profile is defined by a Profile element