Skip to content

Commit eaa4630

Browse files
author
Philipp Schossig
committed
Added the structs: ClientRepresentation, ResourceServerRepresentation, PolicyRepresentation, ResourceRepresentation and ScopeRepresentation. Some are of the Type ENUM, I didn't find a quick way to insert those. They are marked with //TODO, also two 'strange' occurences are also marked with //TODO
1 parent 324352b commit eaa4630

File tree

2 files changed

+100
-4
lines changed

2 files changed

+100
-4
lines changed

.scannerwork/uast-generator-go-linux-amd64

100755100644
File mode changed.

models.go

+100-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package gocloak
22

3-
import "encoding/json"
3+
import (
4+
"encoding/json"
5+
)
46

57
// GetQueryParams converts the struct to map[string]string
68
// The fields tags must have `json:"<name>,string,omitempty"` format for all types, except strings
@@ -255,10 +257,104 @@ type ProtocolMappersConfig struct {
255257
JSONTypeLabel string `json:"jsonType.label"`
256258
}
257259

258-
// Client is a Client
260+
// Client is a ClientRepresentation
259261
type Client struct {
260-
ID string `json:"id"`
261-
ClientID string `json:"clientId"`
262+
Access map[string]string `json:"access,omitempty"`
263+
AdminURL string `json:"adminUrl,omitempty"`
264+
Attributes map[string]string `json:"attributes,omitempty"`
265+
AuthenticationFlowBindingOverrides map[string]string `json:"authenticationFlowBindingOverrides,omitempty"`
266+
AuthorizationServicesEnabled bool `json:"authorizationServicesEnabled,omitempty"`
267+
AuthorizationSettings ResourceServerRepresentation `json:"authorizationSettings,omitempty"`
268+
BaseURL string `json:"baseURL,omitempty"`
269+
BaererOnly bool `json:"barerOnly,omitempty"`
270+
ClientAuthenticatorType string `json:"clientAuthenticatorType,omitempty"`
271+
ClientID string `json:"clientId,omitempty"`
272+
ConsentRequiered bool `json:"consentRequiered,omitempty"`
273+
DefaultClientScopes []string `json:"defaultClientScopes,omitempty"`
274+
DefaultRoles []string `json:"defaultRoles,omitempty"`
275+
Description string `json:"description,omitempty"`
276+
DirectAccessGrantsEnabled bool `json:"directAccessGrantsEnabled,omitempty"`
277+
Enabled bool `json:"enabled,omitempty"`
278+
FrontChannelLogout bool `json:"enabled,omitempty"`
279+
FullScopeAllowed bool `json:"fullScopeAllowed,omitempty"`
280+
ID string `json:"id"`
281+
ImplicitFlowEnabled string `json:"implicitFlowEnabled,omitempty"`
282+
Name string `json:"name,omitempty"`
283+
NodeReRegistrationTimeout int32 `json:"nodeReRegistrationTimeout,omitempty"`
284+
NotBefore int32 `json:"notBefore,omitempty"`
285+
OptionalClientScopes []string `json:"optionalClientScopes,omitempty"`
286+
Origin string `json:"origin,omitempty"`
287+
Protocol string `json:"protocol,omitempty"`
288+
ProtocolMappers []ProtocolMapperRepresentation `json:"protocolMappers,omitempty"`
289+
PublicClient bool `json:"PublicClient,omitempty"`
290+
RedirectURIs []string `json:"redirectUris,omitempty"`
291+
RegisteredNodes map[string]string `json:"registeredNodes,omitempty"`
292+
RegistrationAccessToken string `json:"registrationAccessToken,omitempty"`
293+
RootURL string `json:"rootUrl,omitempty"`
294+
Secret string `json:"secret,omitempty"`
295+
ServiceAccountsEnabled bool `json:"serviceAccountsEnabled,omitempty"`
296+
StandardFlowEnabled bool `json:"standardFlowEnabled,omitempty"`
297+
SurrogateAuthRequired bool `json:"surrogateAuthRequired,omitempty"`
298+
WebOrigins []string `json:"webOrigins,omitempty"`
299+
}
300+
301+
// ResourceServerRepresentation represents the resources of a Server
302+
type ResourceServerRepresentation struct {
303+
AllowRemoteResourceManagement bool `json:"allowRemoteResourceManagement,omitempty"`
304+
ClientID string `json:"clientId,omitempty"`
305+
id string `json:"id,omitempty"`
306+
Name string `json:"name,omitempty"`
307+
Policies []PolicyRepresentation `json:"policies,omitempty"`
308+
PolicyEnforcementMode string `json:"policyEnforcementMode,omitempty"` //TODO: This is an ENUM(ENFORCING,PERMISSIVE,DISABLED) in the template
309+
Resources []ResourceRepresentation `json:"resources,omitempty"`
310+
Scopes []ScopeRepresentation `json:"scopes,omitempty"`
311+
}
312+
313+
// PolicyRepresentation is a representation of a Policy
314+
type PolicyRepresentation struct {
315+
Config map[string]string `json:"config,omitempty"`
316+
DecisionStrategy string `json:"decisionStrategy,omitempty"` //TODO: This is an ENUM(AFFIRMATIVE,UNANIMOUS,CONSENSUS) in the template
317+
Description string `json:"description,omitempty"`
318+
ID string `json:"id,omitempty"`
319+
Logic string `json:"logic,omitempty"` //TODO: This is an ENUM(POSITIVE,NEGATIVE) in the template
320+
Name string `json:"name,omitempty"`
321+
Owner string `json:"owner,omitempty"`
322+
Policies []string `json:"policies,omitempty"`
323+
Resources []string `json:"resources,omitempty"`
324+
Scopes []string `json:"scopes,omitempty"`
325+
Type string `json:"type,omitempty"`
326+
}
327+
328+
// ResourceRepresentation is a representation of a Resource
329+
type ResourceRepresentation struct {
330+
ID string `json:"id,omitempty"` //TODO: is marked "_optional" in template, input error or deliberate?
331+
Attributes map[string]string `json:"attributes,omitempty"`
332+
DisplayName string `json:"displayName,omitempty"`
333+
IconURI string `json:"icon_uri,omitempty"` //TODO: With "_" because that's how it's written down in the template
334+
Name string `json:"name,omitempty"`
335+
OwnerManagedAccess bool `json:"ownerManagedAccess,omitempty"`
336+
Scopes []ScopeRepresentation `json:"scopes,omitempty"`
337+
Type string `json:"type,omitempty"`
338+
URIs []string `json:"uris,omitempty"`
339+
}
340+
341+
// ScopeRepresentation is a represents a Scope
342+
type ScopeRepresentation struct {
343+
DisplayName string `json:"displayName,omitempty"`
344+
IconURI string `json:"iconUri,omitempty"`
345+
ID string `json:"id,omitempty"`
346+
Name string `json:"name,omitempty"`
347+
Policies []PolicyRepresentation `json:"policies,omitempty"`
348+
Resources []ResourceRepresentation `json:"resources,omitempty"`
349+
}
350+
351+
// ProtocolMapperRepresentation represents....
352+
type ProtocolMapperRepresentation struct {
353+
Config map[string]string `json:"config,omitempty"`
354+
ID string `json:"id,omitempty"`
355+
Name string `json:"name,omitempty"`
356+
Protocol string `json:"protocol,omitempty"`
357+
ProtocolMapper string `json:"protocolMapper,omitempty"`
262358
}
263359

264360
// GetClientsParams represents the query parameters

0 commit comments

Comments
 (0)