-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
APIGOV-29550 - Custom Attributes on Application Support (#889)
* APIGOV-29629 - add create and removal hooks for APDs (#879) * codegen update * resource updates * gen update * create application profile definition builder * updates to code gen * add debug flag to codegen * update test whitespace * add cleanup hook for agent sto use to remove app profiles * fix unit test * APIGOV-29630 - Hooks for managed application provisioning (#881) * codegen update * resource updates * gen update * create application profile definition builder * updates to code gen * add debug flag to codegen * update test whitespace * add cleanup hook for agent sto use to remove app profiles * fix unit test * remove all traces of governance agent type * discovery to subscribe to managed application profile events * remove governance agent * linting fixes * revert change * update provisioner registration process * add application profile provision handling * add unit tests and updates for man app profiles * linter fixes * remove adding finalizer to MAP resource * update to add APD to ARD on registration * subscribe to application profile definitions events and update cache * APIGOV-29632 - fixes found while testing with agent (#886) * update caching for app prof def * fix watch topic * add bool prop builder * update to add application profile name to all access requests * fixes for boolean property * add tests for boolean property builder * APIGOV-29633 - updates for application profile provisioning (#887) * update property builder to allow setting enum map * add func to get mapped enums from schema * update man app prof handling for mapped types * update ar and cred processing for enum mapping * add new mock type for testing * update string builder to only add enum map when present * fix type * handle man app profs with mp resources * update application profile ard referencing * update test
- Loading branch information
1 parent
cd43e11
commit ce88fbd
Showing
98 changed files
with
6,379 additions
and
318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package cache | ||
|
||
import v1 "github.com/Axway/agent-sdk/pkg/apic/apiserver/models/api/v1" | ||
|
||
// Access Request Definition cache management | ||
|
||
// AddApplicationProfileDefinition - add/update ApplicationProfileDefinition resource in cache | ||
func (c *cacheManager) AddApplicationProfileDefinition(resource *v1.ResourceInstance) { | ||
defer c.setCacheUpdated(true) | ||
|
||
c.apdMap.SetWithSecondaryKey(resource.Metadata.ID, resource.Name, resource) | ||
} | ||
|
||
// GetApplicationProfileDefinitionKeys - returns keys for ApplicationProfileDefinition cache | ||
func (c *cacheManager) GetApplicationProfileDefinitionKeys() []string { | ||
c.ApplyResourceReadLock() | ||
defer c.ReleaseResourceReadLock() | ||
|
||
return c.apdMap.GetKeys() | ||
} | ||
|
||
// GetApplicationProfileDefinitionByName - returns resource from ApplicationProfileDefinition cache based on resource name | ||
func (c *cacheManager) GetApplicationProfileDefinitionByName(name string) (*v1.ResourceInstance, error) { | ||
c.ApplyResourceReadLock() | ||
defer c.ReleaseResourceReadLock() | ||
|
||
item, err := c.apdMap.GetBySecondaryKey(name) | ||
if item != nil { | ||
if ard, ok := item.(*v1.ResourceInstance); ok { | ||
ard.CreateHashes() | ||
return ard, nil | ||
} | ||
} | ||
return nil, err | ||
} | ||
|
||
// GetApplicationProfileDefinitionByID - returns resource from ApplicationProfileDefinition cache based on resource id | ||
func (c *cacheManager) GetApplicationProfileDefinitionByID(id string) (*v1.ResourceInstance, error) { | ||
c.ApplyResourceReadLock() | ||
defer c.ReleaseResourceReadLock() | ||
|
||
item, err := c.apdMap.Get(id) | ||
if item != nil { | ||
if ard, ok := item.(*v1.ResourceInstance); ok { | ||
ard.CreateHashes() | ||
return ard, nil | ||
} | ||
} | ||
return nil, err | ||
} | ||
|
||
// DeleteApplicationProfileDefinition - deletes the ApplicationProfileDefinition cache based on resource id | ||
func (c *cacheManager) DeleteApplicationProfileDefinition(id string) error { | ||
defer c.setCacheUpdated(true) | ||
|
||
return c.apdMap.Delete(id) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.