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

Update to v4.8.0-rc1 #72

Merged
merged 5 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 8 additions & 8 deletions .github/workflows/backend_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ jobs:
run: |
echo 'package main
// This file is auto-generated - DO NOT EDIT
import _ "github.com/cloudfoundry-incubator/stratos/src/jetstream/plugins/autoscaler"
import _ "github.com/cloudfoundry-incubator/stratos/src/jetstream/plugins/cloudfoundry"
import _ "github.com/cloudfoundry-incubator/stratos/src/jetstream/plugins/cfapppush"
import _ "github.com/cloudfoundry-incubator/stratos/src/jetstream/plugins/cfappssh"
import _ "github.com/cloudfoundry-incubator/stratos/src/jetstream/plugins/userinvite"
import _ "github.com/cloudfoundry-incubator/stratos/src/jetstream/plugins/analysis"
import _ "github.com/cloudfoundry-incubator/stratos/src/jetstream/plugins/kubernetes"
import _ "github.com/cloudfoundry-incubator/stratos/src/jetstream/plugins/monocular"' > src/jetstream/extra_plugins.go
import _ "github.com/cloudfoundry-community/stratos/src/jetstream/plugins/autoscaler"
import _ "github.com/cloudfoundry-community/stratos/src/jetstream/plugins/cloudfoundry"
import _ "github.com/cloudfoundry-community/stratos/src/jetstream/plugins/cfapppush"
import _ "github.com/cloudfoundry-community/stratos/src/jetstream/plugins/cfappssh"
import _ "github.com/cloudfoundry-community/stratos/src/jetstream/plugins/userinvite"
import _ "github.com/cloudfoundry-community/stratos/src/jetstream/plugins/analysis"
import _ "github.com/cloudfoundry-community/stratos/src/jetstream/plugins/kubernetes"
import _ "github.com/cloudfoundry-community/stratos/src/jetstream/plugins/monocular"' > src/jetstream/extra_plugins.go

- name: Run tests
run: build/bk-build.sh test
3 changes: 3 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -403,5 +403,8 @@
"@schematics/angular:directive": {
"prefix": "app"
}
},
"cli": {
"analytics": false
}
}
29 changes: 19 additions & 10 deletions bin/package
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,26 @@ node::install() {

mkdir -p "${node_install_dir}"

if [[ ! -f "${node_install_dir}/go/bin/go" ]]; then
NODE_MD5="5bda713bd4aa39394536fc48c744854b"
URL=https://buildpacks.cloudfoundry.org/dependencies/node/node-${NODE_VERSION}-linux-x64-40e8e080.tgz
if [[ ! -f "${node_install_dir}/bin/node" ]]; then
# - name: node
# version: 20.13.1
# uri: https://buildpacks.cloudfoundry.org/dependencies/node/node_20.13.1_linux_x64_cflinuxfs4_71ec5c92.tgz
# sha256: 71ec5c92b35770170dad21ff65130f3e4201e8a0bcd32986e5dcf32b57f379e6
# cf_stacks:
# - cflinuxfs4
# source: https://nodejs.org/dist/v20.13.1/node-v20.13.1.tar.gz
# source_sha256: a85ee53aa0a5c2f5ca94fa414cdbceb91eb7d18a77fc498358512c14cc6c6991

NODE_SHA2="71ec5c92b35770170dad21ff65130f3e4201e8a0bcd32986e5dcf32b57f379e6"
URL=https://buildpacks.cloudfoundry.org/dependencies/node/node_${NODE_VERSION}_linux_x64_cflinuxfs4_71ec5c92.tgz

echo "-----> Download Nodejs ${NODE_VERSION}"
curl -s -L --retry 15 --retry-delay 2 $URL -o ${download_file}

DOWNLOAD_MD5=$(md5sum ${download_file} | cut -d ' ' -f 1)
DOWNLOAD_SHA2=$(sha256sum ${download_file} | cut -d ' ' -f 1)

if [[ ${DOWNLOAD_MD5} != ${NODE_MD5} ]]; then
echo " **ERROR** MD5 mismatch: got $DOWNLOAD_MD5 expected $NODE_MD5"
if [[ ${DOWNLOAD_SHA2} != ${NODE_SHA2} ]]; then
echo " **ERROR** MD5 mismatch: got $DOWNLOAD_SHA2 expected $NODE_SHA2"
exit 1
fi

Expand All @@ -41,9 +50,9 @@ declare git_url git_tag work_dir
declare -x TAG NODE_VERSION TMP_DIR

git_url="https://github.com/cloudfoundry-community/stratos.git"
git_tag="${TAG:-master}}"
git_tag="${TAG:-master}"
work_dir="${PWD}"
NODE_VERSION="${NODE_VERISON:-8.11.2}"
NODE_VERSION="${NODE_VERISON:-20.13.1}"
TMP_DIR=/tmp

git clone "${git_url}" stratos-ui || true
Expand All @@ -57,7 +66,7 @@ fi

function exit_trap() {
# See: install_nodejs.sh
NODE_VERSION="8.11.2"
NODE_VERSION="20.13.1"
rm -rf "/tmp/node${NODE_VERSION}.tar.gz" "/tmp/node${NODE_VERSION}"
}
trap exit_trap EXIT
Expand Down Expand Up @@ -99,7 +108,7 @@ echo "web: ./deploy/cloud-foundry/start.sh" > "${build_dir}/Procfile"

ls -lah "${build_dir}"
cd "${build_dir}"
zip -r "${work_dir}}/stratos-ui-packaged.zip" ./*
zip -r "${work_dir}/stratos-ui-packaged.zip" ./*
cd "${work_dir}"

exit 0
3 changes: 3 additions & 0 deletions build/bk-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ swag init --parseDependency

if [ "${ACTION}" == "build" ]; then
echo "Building backend ..."
echo "Disk Space ${PWD}"
df -hT

echo "Building version: ${VERSION}"
go build -ldflags -X=main.appVersion=${VERSION}
echo "Build complete ..."
Expand Down
4 changes: 3 additions & 1 deletion deploy/cloud-foundry/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ YELLOW="\033[93m"
RESET="\033[0m"
BOLD="\033[1m"

VENDOR_FOLDER=tmp/go/src/github.com/cloudfoundry-incubator/stratos/vendor
VENDOR_FOLDER=tmp/go/src/github.com/cloudfoundry-community/stratos/vendor

function log {
COLOR=${2:-}
Expand Down Expand Up @@ -63,6 +63,8 @@ fi
log "Building back-end" $CYAN
./build/bk-build.sh

log "Copying executable" $CYAN

# Copy backend executable here
cp src/jetstream/jetstream .

Expand Down
2 changes: 1 addition & 1 deletion manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ applications:
disk_quota: 1024M
host: console
timeout: 180
buildpack: https://github.com/cloudfoundry-incubator/stratos-buildpack#v4.0
buildpack: https://github.com/cloudfoundry-community/stratos-buildpack#v5
health-check-type: port
# env:
# Override CF API endpoint URL inferred from VCAP_APPLICATION env
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/packages/devkit/src/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if (backendPlugins.length === 0) {

// Check that the plugin exists
if (fs.existsSync(path.join(backendFolder, 'plugins', pkg))) {
fs.appendFileSync(backendPluginsFile, `import _ "github.com/cloudfoundry-incubator/stratos/src/jetstream/plugins/${pkg}"\n`);
fs.appendFileSync(backendPluginsFile, `import _ "github.com/cloudfoundry-community/stratos/src/jetstream/plugins/${pkg}"\n`);
console.log(` + ${pkg}`)
} else {
console.log(` + ${pkg} : WARNING: Backend plugin does not exist`);
Expand Down
4 changes: 2 additions & 2 deletions src/jetstream/api/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/cloudfoundry-incubator/stratos/src/jetstream/api
module github.com/cloudfoundry-community/stratos/src/jetstream/api

go 1.21.0
go 1.21

require (
github.com/golang/mock v1.6.0
Expand Down
2 changes: 1 addition & 1 deletion src/jetstream/api/mock/mock_auth.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions src/jetstream/api/sessiondata.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ type SessionDataStore interface {

// Cleanup runs a background goroutine every interval that deletes expired sessions from the database
Cleanup(interval time.Duration) (chan<- struct{}, <-chan struct{})

// StopCleanup stops the background cleanup from running
StopCleanup(quit chan<- struct{}, done <-chan struct{})


}
2 changes: 1 addition & 1 deletion src/jetstream/api/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/url"
"reflect"

api "github.com/cloudfoundry-incubator/stratos/src/jetstream/api/config"
api "github.com/cloudfoundry-community/stratos/src/jetstream/api/config"
"github.com/gorilla/sessions"
"github.com/labstack/echo/v4"
)
Expand Down
2 changes: 1 addition & 1 deletion src/jetstream/apikeys.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"net/http"

"github.com/cloudfoundry-incubator/stratos/src/jetstream/api/config"
"github.com/cloudfoundry-community/stratos/src/jetstream/api/config"
"github.com/labstack/echo/v4"
log "github.com/sirupsen/logrus"
)
Expand Down
8 changes: 4 additions & 4 deletions src/jetstream/apikeys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"net/http"
"testing"

"github.com/cloudfoundry-incubator/stratos/src/jetstream/api"
"github.com/cloudfoundry-incubator/stratos/src/jetstream/api/config"
mock_api "github.com/cloudfoundry-incubator/stratos/src/jetstream/api/mock"
mock_apikeys "github.com/cloudfoundry-incubator/stratos/src/jetstream/repository/apikeys/mock"
"github.com/cloudfoundry-community/stratos/src/jetstream/api"
"github.com/cloudfoundry-community/stratos/src/jetstream/api/config"
mock_api "github.com/cloudfoundry-community/stratos/src/jetstream/api/mock"
mock_apikeys "github.com/cloudfoundry-community/stratos/src/jetstream/repository/apikeys/mock"
"github.com/golang/mock/gomock"
"github.com/labstack/echo/v4"
log "github.com/sirupsen/logrus"
Expand Down
2 changes: 1 addition & 1 deletion src/jetstream/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/labstack/echo/v4"

"github.com/cloudfoundry-incubator/stratos/src/jetstream/api"
"github.com/cloudfoundry-community/stratos/src/jetstream/api"
)

// LoginHookFunc - function that can be hooked into a successful user login
Expand Down
2 changes: 1 addition & 1 deletion src/jetstream/auth_providers.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import "github.com/cloudfoundry-incubator/stratos/src/jetstream/api"
import "github.com/cloudfoundry-community/stratos/src/jetstream/api"

// log "github.com/sirupsen/logrus"

Expand Down
12 changes: 6 additions & 6 deletions src/jetstream/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import (

log "github.com/sirupsen/logrus"

"github.com/cloudfoundry-incubator/stratos/src/jetstream/api"
"github.com/cloudfoundry-incubator/stratos/src/jetstream/api/config"
mock_api "github.com/cloudfoundry-incubator/stratos/src/jetstream/api/mock"
"github.com/cloudfoundry-incubator/stratos/src/jetstream/crypto"
"github.com/cloudfoundry-incubator/stratos/src/jetstream/datastore"
"github.com/cloudfoundry-incubator/stratos/src/jetstream/testutils"
"github.com/cloudfoundry-community/stratos/src/jetstream/api"
"github.com/cloudfoundry-community/stratos/src/jetstream/api/config"
mock_api "github.com/cloudfoundry-community/stratos/src/jetstream/api/mock"
"github.com/cloudfoundry-community/stratos/src/jetstream/crypto"
"github.com/cloudfoundry-community/stratos/src/jetstream/datastore"
"github.com/cloudfoundry-community/stratos/src/jetstream/testutils"
. "github.com/smartystreets/goconvey/convey"
)

Expand Down
6 changes: 3 additions & 3 deletions src/jetstream/authcnsi.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"github.com/labstack/echo/v4"
log "github.com/sirupsen/logrus"

"github.com/cloudfoundry-incubator/stratos/src/jetstream/api"
"github.com/cloudfoundry-incubator/stratos/src/jetstream/api/config"
"github.com/cloudfoundry-incubator/stratos/src/jetstream/repository/tokens"
"github.com/cloudfoundry-community/stratos/src/jetstream/api"
"github.com/cloudfoundry-community/stratos/src/jetstream/api/config"
"github.com/cloudfoundry-community/stratos/src/jetstream/repository/tokens"
)

// CFAdminIdentifier - The scope that Cloud Foundry uses to convey administrative level perms
Expand Down
6 changes: 3 additions & 3 deletions src/jetstream/authlocal.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (

"github.com/labstack/echo/v4"

"github.com/cloudfoundry-incubator/stratos/src/jetstream/api"
"github.com/cloudfoundry-incubator/stratos/src/jetstream/crypto"
"github.com/cloudfoundry-incubator/stratos/src/jetstream/repository/localusers"
"github.com/cloudfoundry-community/stratos/src/jetstream/api"
"github.com/cloudfoundry-community/stratos/src/jetstream/crypto"
"github.com/cloudfoundry-community/stratos/src/jetstream/repository/localusers"
)

// More fields will be moved into here as global portalProxy struct is phased out
Expand Down
18 changes: 9 additions & 9 deletions src/jetstream/authnone.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import (

"github.com/labstack/echo/v4"

"github.com/cloudfoundry-incubator/stratos/src/jetstream/api"
"github.com/cloudfoundry-community/stratos/src/jetstream/api"
)

const (
noAuthUserID = "10000000-1111-2222-3333-444444444444"
)

//More fields will be moved into here as global portalProxy struct is phased out
// More fields will be moved into here as global portalProxy struct is phased out
type noAuth struct {
databaseConnectionPool *sql.DB
localUserScope string
Expand All @@ -30,22 +30,22 @@ func (a *noAuth) ShowConfig(config *api.ConsoleConfig) {
log.Info("... !!!!! No Authentication !!!!!")
}

//Login provides no-auth specific Stratos login
// Login provides no-auth specific Stratos login
func (a *noAuth) Login(c echo.Context) error {
return errors.New("can not login when there is no auth")
}

//Logout provides no-auth specific Stratos login
// Logout provides no-auth specific Stratos login
func (a *noAuth) Logout(c echo.Context) error {
return a.logout(c)
}

//GetUsername gets the user name for the specified local user
// GetUsername gets the user name for the specified local user
func (a *noAuth) GetUsername(userid string) (string, error) {
return api.DefaultAdminUserName, nil
}

//GetUser gets the user guid for the specified local user
// GetUser gets the user guid for the specified local user
func (a *noAuth) GetUser(userGUID string) (*api.ConnectedUser, error) {
var scopes = make([]string, 1)
scopes[0] = "stratos.noauth"
Expand Down Expand Up @@ -84,12 +84,12 @@ func (a *noAuth) BeforeVerifySession(c echo.Context) {
}
}

//VerifySession for no authentication - always passes
// VerifySession for no authentication - always passes
func (a *noAuth) VerifySession(c echo.Context, sessionUser string, sessionExpireTime int64) error {
return nil
}

//generateLoginSuccessResponse
// generateLoginSuccessResponse
func (a *noAuth) generateLoginSuccessResponse(c echo.Context, userGUID string, username string) error {
log.Debug("generateLoginResponse")

Expand Down Expand Up @@ -129,7 +129,7 @@ func (a *noAuth) generateLoginSuccessResponse(c echo.Context, userGUID string, u
return err
}

//logout
// logout
func (a *noAuth) logout(c echo.Context) error {
log.Debug("logout")

Expand Down
4 changes: 2 additions & 2 deletions src/jetstream/authuaa.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (

"github.com/labstack/echo/v4"

"github.com/cloudfoundry-incubator/stratos/src/jetstream/api"
"github.com/cloudfoundry-incubator/stratos/src/jetstream/stringutils"
"github.com/cloudfoundry-community/stratos/src/jetstream/api"
"github.com/cloudfoundry-community/stratos/src/jetstream/stringutils"
)

// UAAAdminIdentifier - The identifier that UAA uses to convey administrative level perms
Expand Down
6 changes: 3 additions & 3 deletions src/jetstream/cnsi.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import (
"crypto/sha1"
"encoding/base64"

"github.com/cloudfoundry-incubator/stratos/src/jetstream/api"
"github.com/cloudfoundry-incubator/stratos/src/jetstream/api/config"
"github.com/cloudfoundry-incubator/stratos/src/jetstream/plugins/userfavorites/userfavoritesendpoints"
"github.com/cloudfoundry-community/stratos/src/jetstream/api"
"github.com/cloudfoundry-community/stratos/src/jetstream/api/config"
"github.com/cloudfoundry-community/stratos/src/jetstream/plugins/userfavorites/userfavoritesendpoints"
)

const dbReferenceError = "unable to establish a database reference: '%v'"
Expand Down
8 changes: 4 additions & 4 deletions src/jetstream/cnsi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"testing"
"time"

"github.com/cloudfoundry-incubator/stratos/src/jetstream/api"
"github.com/cloudfoundry-incubator/stratos/src/jetstream/api/config"
mock_api "github.com/cloudfoundry-incubator/stratos/src/jetstream/api/mock"
"github.com/cloudfoundry-incubator/stratos/src/jetstream/testutils"
"github.com/cloudfoundry-community/stratos/src/jetstream/api"
"github.com/cloudfoundry-community/stratos/src/jetstream/api/config"
mock_api "github.com/cloudfoundry-community/stratos/src/jetstream/api/mock"
"github.com/cloudfoundry-community/stratos/src/jetstream/testutils"
"github.com/golang/mock/gomock"
_ "github.com/satori/go.uuid"
. "github.com/smartystreets/goconvey/convey"
Expand Down
6 changes: 3 additions & 3 deletions src/jetstream/crypto/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ func GenerateRandomBytes(n int) ([]byte, error) {

}

//HashPassword accepts a plaintext password string and generates a salted hash
// HashPassword accepts a plaintext password string and generates a salted hash
func HashPassword(password string) ([]byte, error) {
bytes, err := bcrypt.GenerateFromPassword([]byte(password), 14)
return bytes, err
}

//CheckPasswordHash accepts a bcrypt salted hash and plaintext password.
//It verifies the password against the salted hash
// CheckPasswordHash accepts a bcrypt salted hash and plaintext password.
// It verifies the password against the salted hash
func CheckPasswordHash(password string, hash []byte) error {
err := bcrypt.CompareHashAndPassword(hash, []byte(password))
return err
Expand Down
2 changes: 1 addition & 1 deletion src/jetstream/custom_errors/custom_errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package custom_errors
import (
"fmt"

"github.com/cloudfoundry-incubator/stratos/src/jetstream/custom_errors/constants"
"github.com/cloudfoundry-community/stratos/src/jetstream/custom_errors/constants"
)

type GooseDBNoDatabaseVersionsFoundError struct{}
Expand Down
Loading
Loading