Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
FIT-Connect-SDK - Java
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FIT-Connect
FIT-Connect-SDK - Java
Commits
1f924f75
Commit
1f924f75
authored
1 month ago
by
Martin Vogel
Browse files
Options
Downloads
Patches
Plain Diff
refactor: adjust headers (
planning#2598
)
parent
4fba2f50
No related branches found
No related tags found
1 merge request
!501
planning#2598 Dynamic Limits
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/src/main/java/dev/fitko/fitconnect/core/destination/DestinationApiService.java
+3
-4
3 additions, 4 deletions
...ko/fitconnect/core/destination/DestinationApiService.java
with
3 additions
and
4 deletions
client/src/main/java/dev/fitko/fitconnect/core/destination/DestinationApiService.java
+
3
−
4
View file @
1f924f75
...
...
@@ -18,7 +18,6 @@ import java.util.HashMap;
import
java.util.Map
;
import
java.util.UUID
;
import
static
dev
.
fitko
.
fitconnect
.
core
.
http
.
MimeTypes
.
APPLICATION_JOSE
;
import
static
dev
.
fitko
.
fitconnect
.
core
.
http
.
MimeTypes
.
APPLICATION_JSON
;
public
class
DestinationApiService
implements
DestinationService
{
...
...
@@ -73,7 +72,7 @@ public class DestinationApiService implements DestinationService {
public
void
deleteDestination
(
final
UUID
destinationId
)
{
final
String
urlWithQueryParams
=
String
.
format
(
baseUrl
+
DESTINATION_PATH
,
destinationId
);
try
{
httpClient
.
delete
(
urlWithQueryParams
,
buildHeaders
(
APPLICATION_J
OSE
));
httpClient
.
delete
(
urlWithQueryParams
,
buildHeaders
(
APPLICATION_J
SON
));
}
catch
(
final
RestApiException
e
)
{
throw
new
RestApiException
(
"Could not delete destination "
+
destinationId
,
e
);
}
...
...
@@ -104,7 +103,7 @@ public class DestinationApiService implements DestinationService {
final
String
urlWithQueryParams
=
String
.
format
(
baseUrl
+
DESTINATION_ATTACHMENT_LIMITS_PATH
,
destinationId
);
try
{
final
DestinationLimits
destinationLimits
=
DestinationLimits
.
withChangeRequest
(
limitChangeRequest
);
return
httpClient
.
patch
(
urlWithQueryParams
,
buildHeaders
(
APPLICATION_J
OSE
),
destinationLimits
,
DestinationLimits
.
class
).
getBody
();
return
httpClient
.
patch
(
urlWithQueryParams
,
buildHeaders
(
APPLICATION_J
SON
),
destinationLimits
,
DestinationLimits
.
class
).
getBody
();
}
catch
(
final
RestApiException
e
)
{
throw
new
RestApiException
(
"Could not send limit change request for destination "
+
destinationId
,
e
);
}
...
...
@@ -134,7 +133,7 @@ public class DestinationApiService implements DestinationService {
public
void
addKey
(
final
UUID
destinationId
,
ApiJwk
apiJwk
)
{
final
String
urlWithQueryParams
=
String
.
format
(
baseUrl
+
DESTINATION_KEYS_PATH
,
destinationId
);
try
{
httpClient
.
post
(
urlWithQueryParams
,
buildHeaders
(
APPLICATION_J
OSE
),
apiJwk
,
Void
.
class
);
httpClient
.
post
(
urlWithQueryParams
,
buildHeaders
(
APPLICATION_J
SON
),
apiJwk
,
Void
.
class
);
}
catch
(
final
RestApiException
e
)
{
throw
new
RestApiException
(
"Could not add key "
+
apiJwk
.
getKid
()
+
" to destination "
+
destinationId
,
e
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment