Skip to content

Commit

Permalink
feat: shield to frontier
Browse files Browse the repository at this point in the history
  • Loading branch information
ravisuhag committed Jul 27, 2023
1 parent 0b55ba6 commit 9e66c13
Show file tree
Hide file tree
Showing 420 changed files with 9,482 additions and 9,433 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
with:
push: true
file: "./Dockerfile.dev"
tags: raystack/shield:dev
tags: raystack/frontier:dev
releaser:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ proxies/*.yaml
proxies/*.yml
.temp
temp
shield
frontier
config.yaml
config.yml
coverage.txt
Expand Down
28 changes: 14 additions & 14 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project_name: shield
project_name: frontier

release:
prerelease: auto
Expand All @@ -8,20 +8,20 @@ before:
- make test

builds:
- id: "shield"
- id: "frontier"
goos: [linux, darwin, windows]
goarch: [amd64, arm64]
binary: shield
binary: frontier
main: ./main.go
ldflags:
- -s -w -X github.com/raystack/shield/config.Version={{.Tag}}
- -X github.com/raystack/shield/config.BuildCommit={{.FullCommit}}
- -X github.com/raystack/shield/config.BuildDate={{.Date}}
- -s -w -X github.com/raystack/frontier/config.Version={{.Tag}}
- -X github.com/raystack/frontier/config.BuildCommit={{.FullCommit}}
- -X github.com/raystack/frontier/config.BuildDate={{.Date}}
env:
- CGO_ENABLED=0

archives:
- id: "shield-archive"
- id: "frontier-archive"
format: tar.gz
name_template: >-
{{ .ProjectName }}_
Expand Down Expand Up @@ -52,7 +52,7 @@ dockers:
- goos: linux
goarch: amd64
ids:
- shield
- frontier
dockerfile: Dockerfile
image_templates:
- "docker.io/raystack/{{.ProjectName}}:latest"
Expand All @@ -61,31 +61,31 @@ dockers:
- goos: linux
goarch: arm64
ids:
- shield
- frontier
dockerfile: Dockerfile
image_templates:
- "docker.io/raystack/{{.ProjectName}}:{{ .Tag }}-arm64"

nfpms:
- maintainer: Raystack
description: Identity and authorization system
homepage: https://github.com/raystack/shield
homepage: https://github.com/raystack/frontier
license: Apache 2.0
formats:
- deb
- rpm

scoops:
- homepage: "https://github.com/raystack/shield"
- homepage: "https://github.com/raystack/frontier"
description: "Identity and authorization system"
license: Apache 2.0
bucket:
owner: raystack
name: scoop-bucket

brews:
- name: shield
homepage: "https://github.com/raystack/shield"
- name: frontier
homepage: "https://github.com/raystack/frontier"
description: "Identity and authorization system"
tap:
owner: raystack
Expand All @@ -95,7 +95,7 @@ brews:
dependencies:
- name: git
install: |-
bin.install "shield"
bin.install "frontier"
commit_author:
name: Ravi Suhag
email: [email protected]
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM alpine:3.17

COPY shield /usr/bin/shield
COPY frontier /usr/bin/frontier

EXPOSE 8080
EXPOSE 5556
ENTRYPOINT ["shield"]
ENTRYPOINT ["frontier"]
4 changes: 2 additions & 2 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ COPY . .
RUN make build

FROM alpine:3.17
COPY --from=builder /go/src/app/shield /usr/bin/
COPY --from=builder /go/src/app/frontier /usr/bin/
RUN apk update
RUN apk add ca-certificates

# glibc compatibility library, since go binaries
# don't work well with musl libc that alpine uses
RUN apk add libc6-compat

ENTRYPOINT ["shield", "server"]
ENTRYPOINT ["frontier", "server"]
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
GOVERSION := $(shell go version | cut -d ' ' -f 3 | cut -d '.' -f 2)
NAME=github.com/raystack/shield
NAME=github.com/raystack/frontier
TAG := $(shell git rev-list --tags --max-count=1)
VERSION := $(shell git describe --tags ${TAG})
.PHONY: build check fmt lint test test-race vet test-cover-html help install proto ui
.DEFAULT_GOAL := build
PROTON_COMMIT := "7a4fd9e7a6e557aec52f9dafe0c26fa099e54b0b"
PROTON_COMMIT := "6b20a5b1ce9ef3934c816bf9aee38484d8fcc592"

ui:
@echo " > generating ui build"
Expand All @@ -16,7 +16,7 @@ install:
@go get -d github.com/vektra/mockery/[email protected]

build:
CGO_ENABLED=0 go build -ldflags "-X ${NAME}/config.Version=${VERSION}" -o shield .
CGO_ENABLED=0 go build -ldflags "-X ${NAME}/config.Version=${VERSION}" -o frontier .

generate: ## run all go generate in the code base (including generating mock files)
go generate ./...
Expand Down Expand Up @@ -47,7 +47,7 @@ integration-test:
go test -v -race ./test/integration

benchmark: ## Run benchmarks
go test -run=XX -bench=Benchmark. -count 3 -benchtime=1s github.com/raystack/shield/test/integration
go test -run=XX -bench=Benchmark. -count 3 -benchtime=1s github.com/raystack/frontier/test/integration

coverage: ## print code coverage
go test -race -coverprofile coverage.out -covermode=atomic ./... -tags=unit_test && go tool cover -html=coverage.txt
Expand All @@ -58,8 +58,8 @@ clean :
proto: ## Generate the protobuf files
@echo " > generating protobuf from raystack/proton"
@echo " > [info] make sure correct version of dependencies are installed using 'make install'"
@buf generate https://github.com/raystack/proton/archive/${PROTON_COMMIT}.zip#strip_components=1 --template buf.gen.yaml --path raystack/shield
@cp -R proto/raystack/shield/* proto/ && rm -Rf proto/raystack
@buf generate https://github.com/raystack/proton/archive/${PROTON_COMMIT}.zip#strip_components=1 --template buf.gen.yaml --path raystack/frontier
@cp -R proto/raystack/frontier/* proto/ && rm -Rf proto/raystack
@echo " > protobuf compilation finished"

clean-doc:
Expand Down
68 changes: 34 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Shield
# Frontier

![build workflow](https://github.com/raystack/shield/actions/workflows/test.yml/badge.svg)
![package workflow](https://github.com/raystack/shield/actions/workflows/release.yml/badge.svg)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?logo=apache)](LICENSE)
[![Version](https://img.shields.io/github/v/release/raystack/shield?logo=semantic-release)](Version)
[![Coverage Status](https://coveralls.io/repos/github/raystack/shield/badge.svg?branch=main)](https://coveralls.io/github/raystack/shield?branch=main)
![build workflow](https://github.com/raystack/frontier/actions/workflows/test.yml/badge.svg)
![package workflow](https://github.com/raystack/frontier/actions/workflows/release.yml/badge.svg)
[![License](https://img.frontiers.io/badge/License-Apache%202.0-blue.svg?logo=apache)](LICENSE)
[![Version](https://img.frontiers.io/github/v/release/raystack/frontier?logo=semantic-release)](Version)
[![Coverage Status](https://coveralls.io/repos/github/raystack/frontier/badge.svg?branch=main)](https://coveralls.io/github/raystack/frontier?branch=main)

Shield is an identity and access management tool designed to help organizations secure their systems and data. With Shield, you can manage user authentication and authorization across all your applications and services, ensuring that only authorized users have access to your valuable resources.
Frontier is an identity and access management tool designed to help organizations secure their systems and data. With Frontier, you can manage user authentication and authorization across all your applications and services, ensuring that only authorized users have access to your valuable resources.

<p align="center"><img src="./docs/static/img/overview.svg" /></p>

## Key Features

Discover why users choose Shield as their authorization server
Discover why users choose Frontier as their authorization server

- **User management** Create and manage user accounts for all your applications and services.
- **Organization management** Manage multiple tenants, each with their own set of users, applications, and services.
Expand All @@ -26,105 +26,105 @@ Discover why users choose Shield as their authorization server

## How can I get started?

- [Introduction](docs/docs/introduction.md) provide guidance on how to use Shield and configure it to your needs
- [Concepts](docs/docs/concepts/architecture.md) descibe the primary concepts and architecture behind Shield
- [Reference](docs/docs/reference/api-definitions.md) contains the list of all the APIs that Shield exposes
- [Contributing](docs/docs/contribution/contribute.md) contains resources for anyone who wants to contribute to Shield
- [Introduction](docs/docs/introduction.md) provide guidance on how to use Frontier and configure it to your needs
- [Concepts](docs/docs/concepts/architecture.md) descibe the primary concepts and architecture behind Frontier
- [Reference](docs/docs/reference/api-definitions.md) contains the list of all the APIs that Frontier exposes
- [Contributing](docs/docs/contribution/contribute.md) contains resources for anyone who wants to contribute to Frontier

## Installation

Install Shield on macOS, Windows, Linux, OpenBSD, FreeBSD, and on any machine. Refer this for [installations](https://raystack.github.io/shield/docs/installation).
Install Frontier on macOS, Windows, Linux, OpenBSD, FreeBSD, and on any machine. Refer this for [installations](https://raystack.github.io/frontier/docs/installation).

#### Binary (Cross-platform)

Download the appropriate version for your platform from [releases](https://github.com/raystack/shield/releases) page. Once downloaded, the binary can be run from anywhere.
Download the appropriate version for your platform from [releases](https://github.com/raystack/frontier/releases) page. Once downloaded, the binary can be run from anywhere.
You don’t need to install it into a global location. This works well for shared hosts and other systems where you don’t have a privileged account.
Ideally, you should install it somewhere in your PATH for easy use. `/usr/local/bin` is the most probable location.

#### macOS

`shield` is available via a Homebrew Tap, and as downloadable binary from the [releases](https://github.com/raystack/shield/releases/latest) page:
`frontier` is available via a Homebrew Tap, and as downloadable binary from the [releases](https://github.com/raystack/frontier/releases/latest) page:

```sh
brew install raystack/tap/shield
brew install raystack/tap/frontier
```

To upgrade to the latest version:

```
brew upgrade shield
brew upgrade frontier
```

#### Linux

`shield` is available as downloadable binaries from the [releases](https://github.com/raystack/shield/releases/latest) page. Download the `.deb` or `.rpm` from the releases page and install with `sudo dpkg -i` and `sudo rpm -i` respectively.
`frontier` is available as downloadable binaries from the [releases](https://github.com/raystack/frontier/releases/latest) page. Download the `.deb` or `.rpm` from the releases page and install with `sudo dpkg -i` and `sudo rpm -i` respectively.

#### Windows

`shield` is available via [scoop](https://scoop.sh/), and as a downloadable binary from the [releases](https://github.com/raystack/shield/releases/latest) page:
`frontier` is available via [scoop](https://scoop.sh/), and as a downloadable binary from the [releases](https://github.com/raystack/frontier/releases/latest) page:

```
scoop bucket add shield https://github.com/raystack/scoop-bucket.git
scoop bucket add frontier https://github.com/raystack/scoop-bucket.git
```

To upgrade to the latest version:

```
scoop update shield
scoop update frontier
```

#### Docker

We provide ready to use Docker container images. To pull the latest image:

```
docker pull raystack/shield:latest
docker pull raystack/frontier:latest
```

To pull a specific version:

```
docker pull raystack/shield:0.6.2
docker pull raystack/frontier:0.6.2
```

## Usage

Shield is purely API-driven. It is very easy to get started with Shield. It provides CLI, HTTP and GRPC APIs for simpler developer experience.
Frontier is purely API-driven. It is very easy to get started with Frontier. It provides CLI, HTTP and GRPC APIs for simpler developer experience.

#### CLI

Shield CLI is fully featured and simple to use, even for those who have very limited experience working from the command line. Run `shield --help` to see list of all available commands and instructions to use.
Frontier CLI is fully featured and simple to use, even for those who have very limited experience working from the command line. Run `frontier --help` to see list of all available commands and instructions to use.

List of commands

```
shield --help
frontier --help
```

Print command reference

```sh
shield reference
frontier reference
```

#### API

Shield provides a fully-featured GRPC and HTTP API to interact with Shield server. Both APIs adheres to a set of standards that are rigidly followed. Please refer to [proton](https://github.com/raystack/proton/tree/main/raystack/shield/v1beta1) for GRPC API definitions.
Frontier provides a fully-featured GRPC and HTTP API to interact with Frontier server. Both APIs adheres to a set of standards that are rigidly followed. Please refer to [proton](https://github.com/raystack/proton/tree/main/raystack/frontier/v1beta1) for GRPC API definitions.

## Contribute

Development of Shield happens on GitHub, and we are grateful to the community for contributing bugfixes and
Development of Frontier happens on GitHub, and we are grateful to the community for contributing bugfixes and
improvements.

Read our [contribution guide](https://raystack.github.io/shield/docs/contribute/contribution) to learn about our development process, how to propose
bugfixes and improvements, and how to build and test your changes to Shield.
Read our [contribution guide](https://raystack.github.io/frontier/docs/contribute/contribution) to learn about our development process, how to propose
bugfixes and improvements, and how to build and test your changes to Frontier.

To help you get your feet wet and get you familiar with our contribution process, we have a list of
[good first issues](https://github.com/raystack/shield/labels/good%20first%20issue) that contain bugs which have a relatively
[good first issues](https://github.com/raystack/frontier/labels/good%20first%20issue) that contain bugs which have a relatively
limited scope. This is a great place to get started.

This project exists thanks to all the [contributors](https://github.com/raystack/shield/graphs/contributors).
This project exists thanks to all the [contributors](https://github.com/raystack/frontier/graphs/contributors).

## License

Shield is [Apache 2.0](LICENSE) licensed.
Frontier is [Apache 2.0](LICENSE) licensed.
12 changes: 6 additions & 6 deletions cmd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials/insecure"

shieldv1beta1 "github.com/raystack/shield/proto/v1beta1"
frontierv1beta1 "github.com/raystack/frontier/proto/v1beta1"
"github.com/spf13/cobra"
"google.golang.org/grpc"
)
Expand All @@ -28,7 +28,7 @@ func createConnection(ctx context.Context, host string, caCertFile string) (*grp
return grpc.DialContext(ctx, host, opts...)
}

func createClient(ctx context.Context, host string) (shieldv1beta1.ShieldServiceClient, func(), error) {
func createClient(ctx context.Context, host string) (frontierv1beta1.FrontierServiceClient, func(), error) {
dialTimeoutCtx, dialCancel := context.WithTimeout(ctx, time.Second*2)
conn, err := createConnection(dialTimeoutCtx, host, "")
if err != nil {
Expand All @@ -40,11 +40,11 @@ func createClient(ctx context.Context, host string) (shieldv1beta1.ShieldService
conn.Close()
}

client := shieldv1beta1.NewShieldServiceClient(conn)
client := frontierv1beta1.NewFrontierServiceClient(conn)
return client, cancel, nil
}

func createAdminClient(ctx context.Context, host string) (shieldv1beta1.AdminServiceClient, func(), error) {
func createAdminClient(ctx context.Context, host string) (frontierv1beta1.AdminServiceClient, func(), error) {
dialTimeoutCtx, dialCancel := context.WithTimeout(ctx, time.Second*2)
conn, err := createConnection(dialTimeoutCtx, host, "")
if err != nil {
Expand All @@ -56,7 +56,7 @@ func createAdminClient(ctx context.Context, host string) (shieldv1beta1.AdminSer
conn.Close()
}

client := shieldv1beta1.NewAdminServiceClient(conn)
client := frontierv1beta1.NewAdminServiceClient(conn)
return client, cancel, nil
}

Expand Down Expand Up @@ -88,5 +88,5 @@ func overrideClientConfigHost(cmd *cobra.Command, cliConfig *Config) error {
}

func bindFlagsFromClientConfig(cmd *cobra.Command) {
cmd.PersistentFlags().StringP("host", "h", "", "Shield API service to connect to")
cmd.PersistentFlags().StringP("host", "h", "", "Frontier API service to connect to")
}
Loading

0 comments on commit 9e66c13

Please sign in to comment.