Skip to content

Commit

Permalink
[3.20.x] AM-688: Do not refer to company.com (#3286)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Dec 14, 2023
1 parent e280764 commit 57ab05c
Show file tree
Hide file tree
Showing 17 changed files with 53 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ public void testCustom_emptySettings() {
public void testCustom_partialSettings() {
WebAuthnSettings webAuthnSettings = mock(WebAuthnSettings.class);
when(webAuthnSettings.getRelyingPartyName()).thenReturn("Custom RP name");
when(webAuthnSettings.getOrigin()).thenReturn("https://auth.mycompany.com:8443");
when(webAuthnSettings.getOrigin()).thenReturn("https://auth.gravitee.io:8443");
when(domain.getWebAuthnSettings()).thenReturn(webAuthnSettings);
WebAuthn webAuthn = webAuthnFactory.getObject();
RelyingParty relyingParty = webAuthnFactory.getRelyingParty();
Assert.assertNotNull(webAuthn);
Assert.assertNotNull(relyingParty);
Assert.assertEquals("Custom RP name", relyingParty.getName());
Assert.assertEquals("auth.mycompany.com", relyingParty.getId());
Assert.assertEquals("auth.gravitee.io", relyingParty.getId());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
# # The base_url contains the common url for each overrode endpoints.
# # The list of endpoint that support the mtls_aliases is : token_endpoint, authorization_endpoint, registration_endpoint, userinfo_endpoint, pushed_authorization_request_endpoint, end_session_endpoint, revocation_endpoint, introspection_endpoint
# mtls_aliases: # base URL for mtls_endpoint_aliases (default is null and the standard endpoints will be used)
# base_url: https://mycompany.mlts.com
# base_url: https://gravitee.mlts.com
# endpoints:
# - token_endpoint
# - registration_endpoint
Expand Down Expand Up @@ -77,7 +77,7 @@
# cors:
# Allows to configure the header Access-Control-Allow-Origin (default value: *)
# '*' is a valid value but is considered as a security risk as it will be opened to cross origin requests from anywhere.
# allow-origin: http://developer.mycompany.com
# allow-origin: http://developer.gravitee.io
# Allows to define how long the result of the preflight request should be cached for (default value; 1728000 [20 days])
# max-age: 864000
# Which methods to allow (default value: OPTIONS, GET, POST, PUT, DELETE, PATCH)
Expand Down Expand Up @@ -321,7 +321,7 @@ gateway:
# enabled: false
# exclude-hosts: # list of hosts to exclude from proxy (wildcard hosts are supported)
# - '*.internal.com'
# - internal.mycompany.com
# - internal.gravitee.io
# type: HTTP #HTTP, SOCK4, SOCK5
# http:
# host: localhost
Expand Down Expand Up @@ -349,7 +349,7 @@ gateway:

# Organizations and Environments configuration
# Associate this gateway to a list of environments and their organizations. Use hrids to define these values.
#organizations: mycompany
#organizations: gravitee
#environments: dev,qa

# Sharding tags configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"baseURL" : {
"type" : "string",
"title": "Base URL",
"default": "https://api.company.com/users?username={#user.username}",
"default": "https://api.gravitee.io/users?username={#user.username}",
"description": "Resource URL (support EL)"
},
"httpMethod" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ private Map<String, Object> generateTemplateVariables(String template) {
private UserProperties generateFakeUser() {
final UserProperties fakeUser = new UserProperties();
fakeUser.setDomain(this.domain.getId());
fakeUser.setEmail("john.doe@mycompany.com");
fakeUser.setEmail("john.doe@gravitee.io");
fakeUser.setFirstName("John");
fakeUser.setLastName("Doe");
fakeUser.setClaims(Map.of());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void shouldUpdateEntrypoint() {

UpdateEntrypoint updateEntrypoint = new UpdateEntrypoint();
updateEntrypoint.setName("name");
updateEntrypoint.setUrl("https://auth.company.com");
updateEntrypoint.setUrl("https://auth.gravitee.io");
updateEntrypoint.setTags(Collections.emptyList());

final Entrypoint mockEntrypoint = new Entrypoint();
Expand All @@ -119,7 +119,7 @@ public void shouldNotUpdateEntrypoint_notFound() {

UpdateEntrypoint updateEntrypoint = new UpdateEntrypoint();
updateEntrypoint.setName("name");
updateEntrypoint.setUrl("https://auth.company.com");
updateEntrypoint.setUrl("https://auth.gravitee.io");
updateEntrypoint.setTags(Collections.emptyList());

doReturn(Single.error(new EntrypointNotFoundException(ENTRYPOINT_ID))).when(entrypointService).update(eq(ENTRYPOINT_ID), eq(ORGANIZATION_ID), any(UpdateEntrypoint.class), any(User.class));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void shouldGetEntrypoints_technicalManagementException() {
public void shouldCreate() {
NewEntrypoint newEntrypoint = new NewEntrypoint();
newEntrypoint.setName("name");
newEntrypoint.setUrl("https://auth.company.com");
newEntrypoint.setUrl("https://auth.gravitee.io");
newEntrypoint.setTags(Collections.emptyList());

Entrypoint entrypoint = new Entrypoint();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
# cors:
# Allows to configure the header Access-Control-Allow-Origin (default value: *)
# '*' is a valid value but is considered as a security risk as it will be opened to cross origin requests from anywhere.
# allow-origin: http://developer.mycompany.com
# allow-origin: http://developer.gravitee.io
# Allows to define how long the result of the preflight request should be cached for (default value; 1728000 [20 days])
# max-age: 864000
# Which methods to allow (default value: OPTIONS, GET, POST, PUT, DELETE, PATCH)
Expand All @@ -79,11 +79,11 @@
# login:
# Allows to configure the allowed callback urls during login process (default value: *)
# '*' is a valid value but is considered as a security risk as it will be opened to open redirection issues.
# allow-redirect-urls: https://am-console.mycompany.com/login/callback
# allow-redirect-urls: https://am-console.gravitee.io/login/callback
# logout:
# Allows to configure the allowed callback urls during logout process (default value: *)
# '*' is a valid value but is considered as a security risk as it will be opened to open redirection issues.
# allow-redirect-urls: https://am-console.mycompany.com/logout/callback
# allow-redirect-urls: https://am-console.gravitee.io/logout/callback
# csp:
# enabled: true
# directives:
Expand Down Expand Up @@ -356,7 +356,7 @@ gateway:
# enabled: false
# exclude-hosts: # list of hosts to exclude from proxy (wildcard hosts are supported)
# - '*.internal.com'
# - internal.mycompany.com
# - internal.gravitee.io
# type: HTTP #HTTP, SOCK4, SOCK5
# http:
# host: localhost
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class SendEmailPolicyConfiguration implements PolicyConfiguration {
*/
private String template;
/**
* The email's FROM address. Example: no-reply@mycompany.com
* The email's FROM address. Example: no-reply@gravitee.io
*/
private String from;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"from" : {
"type" : "string",
"title": "From",
"description": "The email's FROM address (support freemarker). Example: no-reply@mycompany.com"
"description": "The email's FROM address (support freemarker). Example: no-reply@gravitee.io"
},
"fromName" : {
"type" : "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import io.reactivex.Single;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
Expand All @@ -60,15 +61,18 @@ public class EntrypointServiceImpl implements EntrypointService {
private final OrganizationService organizationService;
private final AuditService auditService;
private final VirtualHostValidator virtualHostValidator;
private final String gatewayUrl;

public EntrypointServiceImpl(@Lazy EntrypointRepository entrypointRepository,
@Lazy OrganizationService organizationService,
AuditService auditService,
VirtualHostValidator virtualHostValidator) {
VirtualHostValidator virtualHostValidator,
@Value("${gateway.url:http://localhost:8092}") String gatewayUrl) {
this.entrypointRepository = entrypointRepository;
this.organizationService = organizationService;
this.auditService = auditService;
this.virtualHostValidator = virtualHostValidator;
this.gatewayUrl = gatewayUrl;
}

@Override
Expand Down Expand Up @@ -112,7 +116,7 @@ public Flowable<Entrypoint> createDefaults(Organization organization) {
Entrypoint toCreate = new Entrypoint();
toCreate.setName("Default");
toCreate.setDescription("Default entrypoint");
toCreate.setUrl("https://auth.company.com");
toCreate.setUrl(gatewayUrl);
toCreate.setTags(Collections.emptyList());
toCreate.setOrganizationId(organization.getId());
toCreate.setDefaultEntrypoint(true);
Expand Down Expand Up @@ -216,4 +220,4 @@ private Completable validate(Entrypoint entrypoint, Entrypoint oldEntrypoint) {
return Completable.error(new InvalidEntrypointException("Entrypoint must have a valid url."));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public class EntrypointServiceTest {
@Before
public void before() {

cut = new EntrypointServiceImpl(entrypointRepository, organizationService, auditService, virtualHostValidator);
cut = new EntrypointServiceImpl(entrypointRepository, organizationService, auditService, virtualHostValidator, "https://gravitee.io");
}

@Test
Expand Down Expand Up @@ -123,7 +123,7 @@ public void shouldCreateDefaults() {

when(organizationService.findById(ORGANIZATION_ID)).thenReturn(Single.just(organization));
when(entrypointRepository.create(any(Entrypoint.class))).thenAnswer(i -> Single.just(i.getArgument(0)));
doReturn(true).when(virtualHostValidator).isValidDomainOrSubDomain("auth.company.com", null);
doReturn(true).when(virtualHostValidator).isValidDomainOrSubDomain("gravitee.io", null);

TestSubscriber<Entrypoint> obs = cut.createDefaults(organization).test();

Expand Down Expand Up @@ -187,11 +187,11 @@ public void shouldCreate() {
newEntrypoint.setName("name");
newEntrypoint.setDescription("description");
newEntrypoint.setTags(Arrays.asList("tag#1", "tags#2"));
newEntrypoint.setUrl("https://auth.company.com");
newEntrypoint.setUrl("https://auth.gravitee.io");

when(organizationService.findById(ORGANIZATION_ID)).thenReturn(Single.just(organization));
when(entrypointRepository.create(any(Entrypoint.class))).thenAnswer(i -> Single.just(i.getArgument(0)));
doReturn(true).when(virtualHostValidator).isValidDomainOrSubDomain("auth.company.com", null);
doReturn(true).when(virtualHostValidator).isValidDomainOrSubDomain("auth.gravitee.io", null);
TestObserver<Entrypoint> obs = cut.create(ORGANIZATION_ID, newEntrypoint, user).test();

obs.awaitTerminalEvent();
Expand Down Expand Up @@ -250,12 +250,12 @@ public void shouldUpdate() {
updateEntrypoint.setName("name");
updateEntrypoint.setDescription("description");
updateEntrypoint.setTags(Arrays.asList("tag#1", "tags#2"));
updateEntrypoint.setUrl("https://auth.company.com");
updateEntrypoint.setUrl("https://auth.gravitee.io");

when(organizationService.findById(ORGANIZATION_ID)).thenReturn(Single.just(new Organization()));
when(entrypointRepository.findById(ENTRYPOINT_ID, ORGANIZATION_ID)).thenReturn(Maybe.just(existingEntrypoint));
when(entrypointRepository.update(any(Entrypoint.class))).thenAnswer(i -> Single.just(i.getArgument(0)));
doReturn(true).when(virtualHostValidator).isValidDomainOrSubDomain("auth.company.com", null);
doReturn(true).when(virtualHostValidator).isValidDomainOrSubDomain("auth.gravitee.io", null);

TestObserver<Entrypoint> obs = cut.update(ENTRYPOINT_ID, ORGANIZATION_ID, updateEntrypoint, user).test();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,11 @@ <h2>Call your APIs</h2>
Most of your applications require data from APIs. Some of those resources have restricted access, so that only authenticated users with sufficient privileges can access them.
</p>
<div class="code">
<pre class="multiline">curl -X GET \
https://api.mycompany.com/api/v1/data \
-H 'Authorization: Bearer access_token'</pre>
<pre class="multiline">
curl -X GET \
https://api.gravitee.io/api/v1/data \
-H 'Authorization: Bearer access_token'</pre
>
</div>

<h2>Log the User Out</h2>
Expand Down Expand Up @@ -262,8 +264,9 @@ <h2>Getting an access token</h2>
<h2>Call your APIs</h2>
<p>Use your access_token in your request via the Authorization HTTP header to obtain authorized access to the APIs.</p>
<div class="code">
<pre class="multiline">curl -X GET \
https://api.mycompany.com/api/v1/data \
<pre class="multiline">
curl -X GET \
https://api.gravitee.io/api/v1/data \
-H 'Authorization: Bearer access_token'
</pre>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h1>{{emailName}}</h1>
<mat-form-field appearance="outline" floatLabel="always">
<mat-label>From</mat-label>
<input matInput type="email" placeholder="From" name="from" [(ngModel)]="email.from" required [disabled]="!isEnabled()" [readonly]="!canEdit()">
<mat-hint>The email's FROM address. Example: no-reply@mycompany.com</mat-hint>
<mat-hint>The email's FROM address. Example: no-reply@gravitee.io</mat-hint>
</mat-form-field>
<mat-form-field appearance="outline" floatLabel="always">
<mat-label>From name</mat-label>
Expand Down
4 changes: 2 additions & 2 deletions helm/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ httpClient:
enabled: false
exclude-hosts: # list of hosts to exclude from proxy (wildcard hosts are supported)
- '*.internal.com'
- internal.mycompany.com
- internal.gravitee.io
type: HTTP #HTTP, SOCK4, SOCK5
http:
host: localhost
Expand Down Expand Up @@ -715,7 +715,7 @@ httpClient:

=== Gravitee.io Alert trigger & settings

When alerts are enabled, you may want to define your own settings the alert triggers and for the risk_assessment settings.
When alerts are enabled, you may want to define your own settings the alert triggers and for the risk_assessment settings.
To do so, you wan define triggers and settings under the alerts section of the values.yaml.


Expand Down
2 changes: 1 addition & 1 deletion helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ httpClient:
enabled: false
exclude-hosts: # list of hosts to exclude from proxy (wildcard hosts are supported)
- '*.internal.com'
- internal.mycompany.com
- internal.gravitee.io
type: HTTP #HTTP, SOCK4, SOCK5
http:
host: localhost
Expand Down
20 changes: 10 additions & 10 deletions helm/tests/api-configmap_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ tests:
pattern: "[ ]{2}clientAuth: true"
- matchRegex:
path: data.[gravitee.yml]
pattern: "[ ]{3}type: jks"
pattern: "[ ]{3}type: jks"
- matchRegex:
path: data.[gravitee.yml]
pattern: "[ ]{3}path: /keystore/path"
Expand All @@ -264,7 +264,7 @@ tests:
pattern: "[ ]{3}password: \\\"keystorePassword\\\""
- matchRegex:
path: data.[gravitee.yml]
pattern: "[ ]{3}type: pem"
pattern: "[ ]{3}type: pem"
- matchRegex:
path: data.[gravitee.yml]
pattern: "[ ]{3}path: /truststore/path"
Expand Down Expand Up @@ -310,14 +310,14 @@ tests:

- it: should set userManagement activity
set:
userManagement.activity.enabled: true
userManagement.activity.enabled: true
userManagement.activity.anon.algorithm: SHA512
userManagement.activity.anon.salt: someSalt
userManagement.activity.retention.time: 12
userManagement.activity.retention.unit: WEEKS
userManagement.activity.geolocation.variation.latitude: 0.09
userManagement.activity.geolocation.variation.longitude: 0.07

asserts:
- hasDocuments:
count: 1
Expand All @@ -344,7 +344,7 @@ tests:
- matchRegex:
path: data.[gravitee.yml]
pattern: "[ ]{5}longitude: 0.07"


- it: should set default alert engine values disabled
asserts:
Expand Down Expand Up @@ -402,7 +402,7 @@ tests:
- /path/to/keystore1.cert
- /path/to/keystore2.cert
- /path/to/keystore3.cert
alerts.options.ssl.keystore.keys:
alerts.options.ssl.keystore.keys:
- /path/to/keystore1.pem
- /path/to/keystore2.pem
- /path/to/keystore3.pem
Expand All @@ -412,19 +412,19 @@ tests:
alerts.security.enabled: true
alerts.security.username: a_username
alerts.security.password: a_password
alerts.endpoints:
alerts.endpoints:
- https://www.host1.com
- https://www.host2.com
alerts.engines.default.security.username: a_default_username
alerts.engines.default.security.password: a_default_password
alerts.engines.default.endpoints:
alerts.engines.default.endpoints:
- https://www.default.host1.com
- https://www.default.host2.com
alerts.engines.default.ssl.keystore.certs:
- /path/to/default/keystore1.cert
- /path/to/default/keystore2.cert
- /path/to/default/keystore3.cert
alerts.engines.default.ssl.keystore.keys:
alerts.engines.default.ssl.keystore.keys:
- /path/to/default/keystore1.pem
- /path/to/default/keystore2.pem
- /path/to/default/keystore3.pem
Expand All @@ -435,7 +435,7 @@ tests:
alerts.engines.default.ssl.truststore.path: /path/to/default/keystore.p12
alerts.engines.default.ssl.truststore.password: default_changeme_p12


asserts:
- hasDocuments:
count: 1
Expand Down
2 changes: 1 addition & 1 deletion helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ chaos:
# enabled: false
# exclude-hosts: # list of hosts to exclude from proxy (wildcard hosts are supported)
# - '*.internal.com'
# - internal.mycompany.com
# - internal.gravitee.io
# type: HTTP #HTTP, SOCK4, SOCK5
# http:
# host: localhost
Expand Down

0 comments on commit 57ab05c

Please sign in to comment.