Skip to content

Commit

Permalink
Using Fidesmo URL set by user (if any) in authenticated requests; fix…
Browse files Browse the repository at this point in the history
… on README (#72)
  • Loading branch information
luisrodero-fidesmo authored Sep 28, 2021
1 parent 3df03be commit ec40795
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ To produce a build, execute `./mvnw package` and use the generated `target/fdsm.
command line arguments but some behavior can be tuned by setting environment
variables.

- `FIDESMO_AUTH` - the app ID and app key from developer portal in `appId:appKey` format, equivalent of using `--auth appId:appKey`
- `FIDESMO_AUTH` - user and password, or token. Equivalent of using `--auth user:password` or `--auth token`
- `FIDESMO_API_URL` - the URL of the the Fidesmo backend (do not change if unsure)
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@

public class AuthenticatedFidesmoApiClient extends FidesmoApiClient {

private AuthenticatedFidesmoApiClient(ClientAuthentication auth, PrintStream apidump) {
super(auth, apidump);
private AuthenticatedFidesmoApiClient(String url, ClientAuthentication auth, PrintStream apidump) {
super(url, auth, apidump);
}

public static AuthenticatedFidesmoApiClient getInstance(ClientAuthentication auth, PrintStream apidump) throws IllegalArgumentException {
return new AuthenticatedFidesmoApiClient(auth, apidump);
public static AuthenticatedFidesmoApiClient getInstance(String url, ClientAuthentication auth, PrintStream apidump) throws IllegalArgumentException {
return new AuthenticatedFidesmoApiClient(url, auth, apidump);
}

public void put(URI uri, ObjectNode json) throws IOException {
Expand Down
2 changes: 1 addition & 1 deletion tool/src/main/java/com/fidesmo/fdsm/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ private static AuthenticatedFidesmoApiClient getAuthenticatedClient() {
if (auth == null) {
throw new IllegalArgumentException("Provide authentication either via --auth or $FIDESMO_AUTH");
}
return AuthenticatedFidesmoApiClient.getInstance(auth, apiTraceStream);
return AuthenticatedFidesmoApiClient.getInstance(apiurl, auth, apiTraceStream);
}

private static String getAppId() {
Expand Down

0 comments on commit ec40795

Please sign in to comment.