Skip to content

Authentication for ghEntity #14

Open
@mariari

Description

@mariari

Currently how GhEntity and it's children classes work, is that you give it a raw dictionary, and from there GhEntity creates a ZnClient

This has issues when rate limiting is had, or when private data is wanted

GhEntity >> createFrom: aKey with: aBlock onError: anErrorBlock [
	^ rawData 
		at: aKey
		ifPresent: [ :url | 
			| trimmedUrl |
			trimmedUrl := url
				copyWithRegex: '{.*}'
				matchesTranslatedUsing: [ :each | ''].
			ZnClient new 
				get: trimmedUrl
				onSuccess: [ :result | 
					[
						aBlock value: (STON fromString: result)
					] on: Error do: [ :e | anErrorBlock value ] ]
				onError: [ anErrorBlock value ] ]
		ifAbsent: [ {} ]
]

This can easily be changed such that ghEntity has a new slot for an authentication key if desired.

I may work on this myself, and submit a patch as it seems quite trivial to do, however I may not have the time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions