Skip to content

Commit 5fbd904

Browse files
committed
Added methods to get authToken, authType, and secretToken (#119).
1 parent b0e1aac commit 5fbd904

File tree

2 files changed

+55
-1
lines changed

2 files changed

+55
-1
lines changed

src/main/java/org/gitlab4j/api/GitLabApi.java

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,34 @@ public void setSudoAsId(Integer sudoAsId) throws GitLabApiException {
515515
* @return the current sudo as ID, will return null if not in sudo mode
516516
*/
517517
public Integer getSudoAsId() {
518-
return (this.apiClient.getSudoAsId());
518+
return (apiClient.getSudoAsId());
519+
}
520+
521+
/**
522+
* Get the auth token being used by this client.
523+
*
524+
* @return the auth token being used by this client
525+
*/
526+
public String getAuthToken() {
527+
return (apiClient.getAuthToken());
528+
}
529+
530+
/**
531+
* Get the secret token.
532+
*
533+
* @return the secret token
534+
*/
535+
public String getSecretToken() {
536+
return (apiClient.getSecretToken());
537+
}
538+
539+
/**
540+
* Get the TokenType this client is using.
541+
*
542+
* @return the TokenType this client is using
543+
*/
544+
public TokenType getTokenType() {
545+
return (apiClient.getTokenType());
519546
}
520547

521548
/**

src/main/java/org/gitlab4j/api/GitLabApiClient.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,33 @@ public GitLabApiClient(ApiVersion apiVersion, String hostUrl, TokenType tokenTyp
219219
clientConfig.register(JacksonJson.class);
220220
}
221221

222+
/**
223+
* Get the auth token being used by this client.
224+
*
225+
* @return the auth token being used by this client
226+
*/
227+
String getAuthToken() {
228+
return (authToken);
229+
}
230+
231+
/**
232+
* Get the secret token.
233+
*
234+
* @return the secret token
235+
*/
236+
String getSecretToken() {
237+
return (secretToken);
238+
}
239+
240+
/**
241+
* Get the TokenType this client is using.
242+
*
243+
* @return the TokenType this client is using
244+
*/
245+
TokenType getTokenType() {
246+
return (tokenType);
247+
}
248+
222249
/**
223250
* Set the ID of the user to sudo as.
224251
*

0 commit comments

Comments
 (0)