Skip to content

Commit 2ecbc3b

Browse files
authored
Feature/his internal profile (#2887)
* updated local deployment instruction * properties for internal HIS cluster * Update application-internal.yml deleted credentials * logo for codehub sign in button * Update application-internal.yml left only properties that relates to codehub authorization * codehub icon * codehub logo * deleted comments * Update LoginUtils.kt * deleted unnecessary lines * return to correct version of file
1 parent 8167211 commit 2ecbc3b

5 files changed

Lines changed: 93 additions & 17 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
spring:
2+
security:
3+
oauth2:
4+
client:
5+
provider:
6+
codehub:
7+
authorization-uri: https://codehub-g.huawei.com/oauth/authorize
8+
token-uri: https://codehub-g.huawei.com/oauth/token
9+
user-info-uri: https://codehub-g.huawei.com/api/v4/user
10+
user-name-attribute: username
11+
user-info-authentication-method: post
12+
registration:
13+
codehub:
14+
provider: codehub
15+
redirect-uri: '${gateway.frontend.url}/{action}/oauth2/code/{registrationId}'
16+
authorization-grant-type: authorization_code
17+
client-authentication-method: client_secret_post
18+
scope: profile

save-cloud-charts/save-cloud/README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ command line using `--set` flag.
4747

4848
## Local deployment
4949
* Install minikube: https://minikube.sigs.k8s.io/docs/start/
50+
* install csi addon in minikube to provide this StorageClass type in your minikube cluster
51+
```bash
52+
minikube addons enable csi-hostpath-driver
53+
```
54+
* [optional] modify kube config file to use base64 encripted info about certs and keys instead of using path to cert file
55+
```yaml
56+
certificate-authority-data: <base64 encoded cert>
57+
client-certificate-data: <base64 encoded cert>
58+
client-key-data: <base64 encoded cert>
59+
```
5060
* Environment should be prepared:
5161
```bash
5262
minikube ssh
@@ -60,13 +70,9 @@ command line using `--set` flag.
6070
build.docker.tls-verify=true
6171
build.docker.cert-path=<path-to-user-home>/.minikube/certs
6272
```
63-
* (Required only once) Install Helm chart using `values-minikube.yaml`:
64-
```bash
65-
$ helm install save-cloud save-cloud-0.1.0.tgz --namespace save-cloud --values values-minikube.yaml <any other value files and/or --set flags>
66-
```
6773
* (On consecutive deployments) Upgrade an existing Helm release:
6874
```bash
69-
$ helm upgrade save-cloud save-cloud-0.1.0.tgz --namespace save-cloud --values values-minikube.yaml <any other value files and/or --set flags>
75+
$ helm --kube-context=minikube --namespace=save-cloud upgrade -i save-cloud save-cloud-0.1.0.tgz/<or use ulr oci://ghcr.io/saveourtool/save-cloud> --values values-minikube.yaml --values=values-images.yaml <any other value files and/or --set flags>
7076
```
7177
* Database migrations can be run by setting value `mysql.migrations.enabled` to `true` (no additional setup, migrations
7278
are executed by init container, but may be too slow with constant recreations of backend/sandbox pods)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
chartVersion: '0.2.1+1056'
2+
3+
# The version from the "Build and push Docker images" action.
4+
#
5+
# Search the log for the "Successfully built image
6+
# 'ghcr.io/saveourtool/api-gateway:master'" line, or simply
7+
# look up the version of the latest published package at
8+
# <https://github.com/orgs/saveourtool/packages?repo_name=save-cloud>.
9+
dockerTag: '0.4.0-alpha.0.379-70423bd'
10+
gateway:
11+
dockerTag: '0.4.0-alpha.0.379-70423bd'
12+
backend:
13+
dockerTag: '0.4.0-alpha.0.379-70423bd'
14+
frontend:
15+
dockerTag: '0.4.0-alpha.0.379-70423bd'
16+
preprocessor:
17+
dockerTag: '0.4.0-alpha.0.379-70423bd'
18+
orchestrator:
19+
dockerTag: '0.4.0-alpha.0.379-70423bd'
20+
sandbox:
21+
dockerTag: '0.4.0-alpha.0.379-70423bd'
22+
demo:
23+
dockerTag: '0.4.0-alpha.0.379-70423bd'
24+
demo_cpg:
25+
dockerTag: '0.4.0-alpha.0.379-70423bd'

save-frontend-common/src/main/kotlin/com/saveourtool/save/frontend/common/utils/LoginUtils.kt

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
package com.saveourtool.save.frontend.common.utils
88

9-
import com.saveourtool.save.frontend.common.externals.fontawesome.*
10-
import com.saveourtool.save.frontend.common.externals.fontawesome.faCopyright
119
import com.saveourtool.save.frontend.common.externals.fontawesome.faSignInAlt
1210
import com.saveourtool.save.frontend.common.externals.fontawesome.fontAwesomeIcon
1311
import com.saveourtool.save.info.OauthProviderInfo
@@ -43,7 +41,7 @@ fun ChildrenBuilder.processRegistrationId(
4341
) = oauthLoginForKnownAwesomeIcons(
4442
oauthProvidersFeConfig,
4543
mapKnownUploadedIcons(oauthProvidersFeConfig.provider.registrationId),
46-
mapKnownFontAwesomeIcons(oauthProvidersFeConfig.provider.registrationId)
44+
faSignInAlt
4745
)
4846

4947
/**
@@ -88,15 +86,6 @@ private fun ChildrenBuilder.oauthLoginForKnownAwesomeIcons(
8886
}
8987
}
9088

91-
/**
92-
* @param registrationId oauth provider name (same as in spring security config) from api-gateway
93-
*/
94-
fun mapKnownFontAwesomeIcons(registrationId: String) =
95-
when (registrationId) {
96-
"codehub" -> faCopyright
97-
else -> faSignInAlt
98-
}
99-
10089
/**
10190
* Mapping ONLY for those icons that are uploaded to SAVE.
10291
* Please note that companies like google strictly prohibits incorrect usage of sign-in buttons:
@@ -110,5 +99,6 @@ fun mapKnownUploadedIcons(registrationId: String) =
11099
"gitee" -> "/img/gitee.svg"
111100
"github" -> "/img/github.svg"
112101
"google" -> "/img/google.svg"
102+
"codehub" -> "/img/codehub.svg"
113103
else -> ""
114104
}
Lines changed: 37 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)