Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flar UI vue 3 sso #589

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a8650cf
CFNP || added jenkinsfile + build scripts for CI/CD (#2)
himanshu-allen Sep 24, 2024
df00579
feat: vue version upgrade and sso
Gaurabag Sep 26, 2024
79d65c3
fix: added access token correct and envs and login
Gaurabag Sep 26, 2024
9c56e9d
fix: added fix
Gaurabag Sep 26, 2024
bb26b00
fix: delete icon
Gaurabag Sep 26, 2024
fb682a3
fix: added info
Gaurabag Sep 26, 2024
1b45077
updated dockerfile
himanshu-allen Oct 1, 2024
4cb2f0c
fix: added env setup
Gaurabag Oct 3, 2024
380b101
updated and fixed test cases for jwt middleware + sonar and linting f…
himanshu-allen Oct 15, 2024
c8d67d3
updated jwt library in existing testcase: subject_text.go
himanshu-allen Oct 15, 2024
2d2622e
updated test cases and module name in go mod
himanshu-allen Oct 17, 2024
f8e4013
updated dockerfile for golang 1.22.7
himanshu-allen Oct 17, 2024
e79ff01
updated dockerfile for golang 1.22.7
himanshu-allen Oct 17, 2024
196b733
updated back to go 1.21
himanshu-allen Oct 17, 2024
0566334
docker update for alpine
himanshu-allen Oct 17, 2024
1ecdd29
added browser files for exclusion
himanshu-allen Oct 17, 2024
773a57e
added test cases
himanshu-allen Oct 17, 2024
da09981
sonar reduced cognitive complexity
himanshu-allen Oct 17, 2024
8cae4d1
updated for segment id fix if there are no matching segments
himanshu-allen Oct 18, 2024
68e87b3
minor fixes for updated by user
himanshu-allen Oct 18, 2024
d5b34dd
fixed: middleware issue while serving static file
himanshu-allen Oct 18, 2024
736f60c
test fix
himanshu-allen Oct 18, 2024
270a657
fix: debug console editor fix, tags , notes update fix
Gaurabag Oct 22, 2024
ec3bfc1
update api url for bff internal url + const
himanshu-allen Oct 22, 2024
eb39f5c
udpated docker file for env variables as well
himanshu-allen Oct 23, 2024
3c7a9af
added comment for segment id bug fix
himanshu-allen Oct 23, 2024
755bd0d
updated docker file
himanshu-allen Oct 23, 2024
525c339
resolved comments
himanshu-allen Oct 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cd_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Publish Docker SemVer Tag
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: openflagr/flagr
name: Allen-Career-Institute/flagr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quick question, is this supposed to be a PR for openflagr upstream or your own github org's fork?

username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Changelog

https://github.com/openflagr/flagr/releases
https://github.com/Allen-Career-Institute/flagr/releases
44 changes: 33 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
######################################
# Prepare npm_builder
######################################
FROM node:16 as npm_builder
WORKDIR /go/src/github.com/openflagr/flagr
ADD . .
FROM node:18 as npm_builder
WORKDIR /go/src/github.com/Allen-Career-Institute/flagr
ARG ENVIRONMENT=local
ENV ENVIRONMENT=${ENVIRONMENT}
COPY . .
ARG FLAGR_UI_POSSIBLE_ENTITY_TYPES=null
ENV VUE_APP_FLAGR_UI_POSSIBLE_ENTITY_TYPES ${FLAGR_UI_POSSIBLE_ENTITY_TYPES}
RUN make build_ui
Expand All @@ -12,29 +14,49 @@ RUN make build_ui
# Prepare go_builder
######################################
FROM golang:1.21-alpine as go_builder
WORKDIR /go/src/github.com/openflagr/flagr
WORKDIR /go/src/github.com/Allen-Career-Institute/flagr

RUN apk add --no-cache git make build-base
ADD . .
RUN apk add --no-cache build-base git make
COPY . .
RUN make build

FROM alpine

COPY --from=go_builder /go/src/github.com/openflagr/flagr/flagr .
COPY --from=go_builder /go/src/github.com/Allen-Career-Institute/flagr/flagr .

ENV HOST=0.0.0.0
# ENV PORT=3000 (for local testing)
ENV PORT=18000

ENV FLAGR_DB_DBDRIVER=sqlite3
ENV FLAGR_DB_DBCONNECTIONSTR=/data/demo_sqlite3.db
ENV FLAGR_RECORDER_ENABLED=false

COPY --from=npm_builder /go/src/github.com/openflagr/flagr/browser/flagr-ui/dist ./browser/flagr-ui/dist
ENV FLAGR_RECORDER_ENABLED=true

# JWT Environment Variables
ENV FLAGR_JWT_AUTH_ENABLED=true
ENV FLAGR_JWT_AUTH_DEBUG=true
ENV FLAGR_JWT_AUTH_WHITELIST_PATHS="/api/v1/health,/api/v1/evaluation,/login,/callback,/static,/favicon.ico"
ENV FLAGR_JWT_AUTH_EXACT_WHITELIST_PATHS=",/,/login,/callback"
ENV FLAGR_JWT_AUTH_COOKIE_TOKEN_NAME="access_token"
# ENV FLAGR_JWT_AUTH_SECRET="secret"
ENV FLAGR_JWT_AUTH_NO_TOKEN_STATUS_CODE=307
# ENV FLAGR_JWT_AUTH_NO_TOKEN_REDIRECT_URL="http://localhost:3000/login" (for local testing)
# ENV FLAGR_JWT_AUTH_NO_TOKEN_REDIRECT_URL="http://localhost:18000/login" (to be overriden in k8 yaml file as per env)
ENV FLAGR_JWT_AUTH_USER_CLAIM=uid
ENV FLAGR_JWT_AUTH_SIGNING_METHOD=HS256

# CORS Environment Variables
ENV FLAGR_CORS_ALLOWED_METHODS="GET,POST,PUT,DELETE,PATCH,OPTIONS"
ENV FLAGR_CORS_ALLOWED_HEADERS="*"

COPY --from=npm_builder /go/src/github.com/Allen-Career-Institute/flagr/browser/flagr-ui/dist ./browser/flagr-ui/dist

RUN addgroup -S appgroup && adduser -S appuser -G appgroup
USER appuser

ADD --chown=appuser:appgroup ./buildscripts/demo_sqlite3.db /data/demo_sqlite3.db
COPY --chown=appuser:appgroup ./buildscripts/demo_sqlite3.db /data/demo_sqlite3.db

# EXPOSE 3000 (for local testing)
EXPOSE 18000

CMD "./flagr"
15 changes: 15 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Wiki: https://acikota.atlassian.net/wiki/spaces/Platform/pages/311787592/Centralising+stages+of+the+pipeline+for+golang+backend+services
@Library('Allen_Shared_Libraries') _
commonPipelineForGolang(
jenkinsAgentImage: '537984406465.dkr.ecr.ap-south-1.amazonaws.com/allen-jenkins-agent:v4',
environment: [
GOPRIVATE : "https://github.com/Allen-Career-Institute/*",
DEPLOY_GITOPS_REPO : "central-gitops-repo",
DEPLOY_TARGET_FILE : "app-charts/flagr/values-dev.yaml",
DEPLOY_TARGET_FILE_LIVE : "app-charts-live/flagr/values-dev.yaml",
DEPLOY_TARGET_BRANCH : "main",
REGISTRY : "537984406465.dkr.ecr.ap-south-1.amazonaws.com",
REPOSITORY : "flagr",
SLACK_CHANNEL : "pipeline-comms"
]
)
23 changes: 18 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
ENVIRONMENT ?= production
PWD := $(shell pwd)
GOPATH := $(shell go env GOPATH)
UIPATH := $(PWD)/browser/flagr-ui

ifeq ($(ENVIRONMENT),dev)
BUILD_CMD = build:dev
else ifeq ($(ENVIRONMENT),stage)
BUILD_CMD = build:stage
else ifeq ($(ENVIRONMENT),local)
BUILD_CMD = build:local
else
BUILD_CMD = build
endif
################################
### Public
################################
Expand All @@ -11,7 +20,7 @@ all: deps gen build build_ui run
rebuild: gen build

test: verifiers
@go test -race -covermode=atomic -coverprofile=coverage.txt github.com/openflagr/flagr/pkg/...
@go test -race -covermode=atomic -coverprofile=coverage.txt github.com/Allen-Career-Institute/flagr/pkg/...

.PHONY: benchmark
benchmark:
Expand All @@ -26,11 +35,11 @@ vendor:

build:
@echo "Building Flagr Server to $(PWD)/flagr ..."
@go build -o $(PWD)/flagr github.com/openflagr/flagr/swagger_gen/cmd/flagr-server
@go build -o $(PWD)/flagr github.com/Allen-Career-Institute/flagr/swagger_gen/cmd/flagr-server

build_ui:
@echo "Building Flagr UI ..."
@cd ./browser/flagr-ui/; npm install && npm run build
@echo "Building Flagr UI ... $(ENVIRONMENT)"
@cd ./browser/flagr-ui/; npm install && npm run $(BUILD_CMD)

run_ui:
@cd ./browser/flagr-ui/; npm run serve
Expand Down Expand Up @@ -87,3 +96,7 @@ swagger: verify_swagger
@mkdir $(PWD)/swagger_gen
@swagger generate server -t ./swagger_gen -f $(PWD)/docs/api_docs/bundle.yaml
@cp /tmp/configure_flagr.go $(PWD)/swagger_gen/restapi/configure_flagr.go 2>/dev/null || :

lint:
find . -name "*.go" ! -name "*.pb.go" | xargs goimports -w
golangci-lint run --timeout 2m0s
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<p align="center">
<a href="https://github.com/openflagr/flagr/actions/workflows/ci.yml?query=branch%3Amain+" target="_blank">
<img src="https://github.com/openflagr/flagr/actions/workflows/ci.yml/badge.svg?branch=main">
<a href="https://github.com/Allen-Career-Institute/flagr/actions/workflows/ci.yml?query=branch%3Amain+" target="_blank">
<img src="https://github.com/Allen-Career-Institute/flagr/actions/workflows/ci.yml/badge.svg?branch=main">
</a>
<a href="https://goreportcard.com/report/github.com/openflagr/flagr" target="_blank">
<img src="https://goreportcard.com/badge/github.com/openflagr/flagr">
<a href="https://goreportcard.com/report/github.com/Allen-Career-Institute/flagr" target="_blank">
<img src="https://goreportcard.com/badge/github.com/Allen-Career-Institute/flagr">
</a>
<a href="https://godoc.org/github.com/openflagr/flagr" target="_blank">
<a href="https://godoc.org/github.com/Allen-Career-Institute/flagr" target="_blank">
<img src="https://img.shields.io/badge/godoc-reference-green.svg">
</a>
<a href="https://github.com/openflagr/flagr/releases" target="_blank">
<img src="https://img.shields.io/github/release/openflagr/flagr.svg?style=flat&color=green">
<a href="https://github.com/Allen-Career-Institute/flagr/releases" target="_blank">
<img src="https://img.shields.io/github/release/Allen-Career-Institute/flagr.svg?style=flat&color=green">
</a>
<a href="https://codecov.io/gh/openflagr/flagr">
<img src="https://codecov.io/gh/openflagr/flagr/branch/main/graph/badge.svg?token=iwjv26grrN">
<a href="https://codecov.io/gh/Allen-Career-Institute/flagr">
<img src="https://codecov.io/gh/Allen-Career-Institute/flagr/branch/main/graph/badge.svg?token=iwjv26grrN">
</a>
</p>

## Introduction
`openflagr/flagr` is a community-driven OSS effort of advancing the development of Flagr.
`Openflagr/flagr` is a community-driven OSS effort of advancing the development of Flagr.

Flagr is an open source Go service that delivers the right experience to the right entity and monitors the impact. It provides feature flags, experimentation (A/B testing), and dynamic configuration. It has clear swagger REST APIs for flags management and flag evaluation.

Expand All @@ -30,8 +30,8 @@ Try it with Docker.

```sh
# Start the docker container
docker pull ghcr.io/openflagr/flagr
docker run -it -p 18000:18000 ghcr.io/openflagr/flagr
docker pull ghcr.io/Allen-Career-Institute/flagr
docker run -it -p 18000:18000 ghcr.io/Allen-Career-Institute/flagr

# Open the Flagr UI
open localhost:18000
Expand Down Expand Up @@ -88,6 +88,6 @@ Error Set:
| Ruby | [rbflagr](https://github.com/openflagr/rbflagr) |

## License and Credit
- [`openflagr/flagr`](https://github.com/openflagr/flagr) Apache 2.0
- [`Allen-Career-Institute/flagr`](https://github.com/Allen-Career-Institute/flagr) Apache 2.0
- [`checkr/flagr`](https://github.com/checkr/flagr) Apache 2.0

4 changes: 3 additions & 1 deletion browser/flagr-ui/.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
BASE_URL=""
VUE_APP_API_URL=http://127.0.0.1:18000/api/v1
VUE_APP_API_URL=http://flagr.allen-demo.in/api/v1
VUE_APP_SSO_API_URL=https://bff-dev.allen-demo.in/internal-bff/
VUE_APP_FLAGR_UI_POSSIBLE_ENTITY_TYPES=null
NODE_ENV=development
4 changes: 3 additions & 1 deletion browser/flagr-ui/.env.production
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
VUE_APP_API_URL=api/v1
VUE_APP_API_URL=http://flagr.allen-live.in/api/v1
VUE_APP_SSO_API_URL=https://api.allen-live.in/internal-bff/
NODE_ENV=production
3 changes: 3 additions & 0 deletions browser/flagr-ui/.env.stage
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
VUE_APP_API_URL=https://flagr.allen-stage.in/api/v1
VUE_APP_SSO_API_URL=https://bff.allen-stage.in/internal-bff/
NODE_ENV=stage
13 changes: 13 additions & 0 deletions browser/flagr-ui/assets/images/google.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
Loading
Loading