MCPcopy
hub / github.com/crowdsecurity/crowdsec / IsEnrolled

Method IsEnrolled

pkg/apiclient/client.go:57–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55}
56
57func (c *ApiClient) IsEnrolled() bool {
58 jwtTransport := c.client.Transport.(*JWTTransport)
59 tokenStr := jwtTransport.Token
60
61 token, _ := jwt.Parse(tokenStr, nil)
62 if token == nil {
63 return false
64 }
65
66 claims := token.Claims.(jwt.MapClaims)
67 _, ok := claims["organization_id"]
68
69 return ok
70}
71
72func (c *ApiClient) GetSubscriptionType() string {
73 jwtTransport := c.client.Transport.(*JWTTransport)

Callers 3

NewServerFunction · 0.80
initAPICMethod · 0.80
queryCAPIStatusFunction · 0.80

Calls 1

ParseMethod · 0.45

Tested by

no test coverage detected